Who says programming is E-A-S-Y? It is never easy, when I was a college student, I almost went crazy with it but I loved and am loving the challenge of solving problems and giving my solutions through the codes.
So, perhaps, these strategies I employ will help assist you:
1. Know the problem. What are the expected input, the process and the expected output. If you are unsure, you may ask to further clarify the problem.
2. Write an algorithm or better a pseudocode to make it easier to write the source code.
3. Try the long method first in solving the problem. If the process is already clear, translate this into a shorter and more efficient solution.
4. Ask your friends or teachers how they propose the solution to be. Compare your solution to theirs. Are they similar or far different? Is your solution more feasible and efficient or not? Choose then to redo or pursue your solution.
5. Unfamiliar with the programming language? Use then your solution in a language you are used to and try it. If this works, similar solution but with different syntax may work in another programming language.
6. Still clueless? It pays off to read and read and practice programming more. . . as a teacher and a student before, I have my programming lapses too but we keep on trying.