Separate different parts of your code into logical units. For example, file system access could be in its own module so it can be replaced more easily when porting to another platform. Also, don't mix low-level UI code and game logic so it's easier to replace UI libs if needed.
DRY (Don't Repeat Yourself)
If you find using a chunk of code in several places, extract a method and replace usages with a call to that method.
Tell, Don't Ask
If you find some object getting various data from another object and performing logic on it, consider moving the logic into the target object's method instead.
Avoid magic numbers
Unnamed numbers are confusing and if a certain value is used in many places, updating it will easily lead to mistakes when you forget to update all occurrences. Use well-named variables instead.
Avoid excessive branching
Control flow is hard to follow if there are many nested branches. Some branches can be converted into methods.
Declare variables close to their usage
The smaller the scope, the easier is your mental load.
If you find yourself doing a for-loop to find a value from a collection, use a specific find-method instead. It makes it clear to the reader what you're doing.
Comment "why" instead of "what"
Don't write in comments things that can be seen from the code.