There is no alternative for practice. The only way to get better at coding is to practice alot.
To approach a problem you must think what the question is asking for, what approach you can use to get to that solution and what its time complexity could be.
In beginning, Don’t worry too much about time complexity as even brute force works for easy questions with small constraints. But as you progress, learn from other people’s code or similar problems. You’ll understand better approachs to do the same problem.
For example, when I was young, i used to do Prime number program in O(n) approach as i used to iterate over 2 to N/2, meanwhile as I grew and practiced, I realized that It can be done in O(rootN).
Similarly, you start fresh.
After every event, even if u dont participate, try to solve the questions and If you don’t get a good approach to solve them, simply go over to Editorials to understand the solution and then make your own solution to submit it.
In time, you’ll be able to solve similar or little different problems more efficiently .