Good rule for learning programming: think of a tiny small part of what you want to do, and then learn enough to do that.
So if it's a game, you might want to learn how to make a sprite move. If you hit problems because you don't know how to open a window to display the sprite, learn how to open a window in instead.
That way each thing you learn becomes part of the framework you need to achieve your eventual goal.