Learn concepts
By reading articles, blogs, documents, or watching videos, you can become familiar with a topic's concepts before attempting to solve it.
Code with pen and paper
Always try to write the code's algorithm or pseudocode before implementing them.
Solve puzzles
Try solving puzzles to improve your thinking and problem-solving skills.
Use step by step approach
Always start with simple queries and work your way up to more complicated ones to balance out the levels.
Discover a programmer's community
To come up with new logic and optimize your code, try talking through answers to difficult problems with other programmers.