(The problem is that your mind, your approach, needs to change, and that change comes with practice and time. And practice always starts with the simple, the controlled, the repeatable, not the full fury of all skills brought together in a high pressure win-or-lose moment.)
Computers are nothing more than repetition machines. Start by writing code to do things that you yourself now do multiple times per unit time.
Start small. Simple things. Let the computer handle the repetition for you, no matter how simplistic and rude and hacky your solution.
Then notice how program A and program B, written to repeat different procedures, have similar processes or structures.
Generalize A and B to make a C that does both.
Do this again for other processes. Over time, your approach will shift. You will notice patterns: Patterns of process, patterns of structure, patterns of relation.
Then you will start solving problems. Only afterwards will you realize you have done so.
(I started coding shell scripts for anything I had to do more than twice - or anything that required "too many characters". I got tired of typing "ls -alt *|head" so I wrote nwst to do it for me. Then I added a numeric option to nwst to control how much head wrote. I got tired of writing "find . -iname" so I wrote fndi. Etc. Etc.)