Start simple. Make copies of existing games. Pong, snake, tetris, pacman. You’ll quickly start encountering problems you don’t know how to solve. Even games that seem simple at first have a lot of complexity you won’t know how to replicate. So you look it up and learn how to do it. Then keep going from there. Soon you’ll learn enough and replicate enough games that you’ll start getting ideas for small games. Try making one. You’ll fail, but keep trying.