Couple of techniques for organising your ‘thinking’:
Nouns and verbs: If you’re starting a new project or a new feature in your game categorise your ideas into classes (the nouns) and methods (the verbs), a simple UML diagram will help you organise your thoughts - or it helps me anyway.
MVC (Model-View-Controller): Another way to work out where to put everything is to categorise your code using the MVC design pattern, quick summary: the model is the state of your game (entities, events, etc), the controller(s) manipulate the model (player actions, animations, game AI, etc) and the view is the representation of the model to the player (scene graph, UI, etc).
Cohesion: A good way to check that you’re organising your code as best as you can (and it will never be perfect) is to consider how concise each chunk of code is, i.e. does it have a straight-forward purpose? is the ‘API’ of that code clear and simple? If the answer is no then you might want to reconsider the design, break that class up, etc. A good test is whether that code can be easily unit-tested, if you find that it’s complicated to test then the code is probably a bit messy.
Just some random thoughts off the top of my head, hope it helps.