Here’s what worked for me:
1) pick a language (it doesn’t matter, C, python, ocaml) and just start writing small things in it. Do this so much that your inner monologue starts speaking the language, that you have an uncontrollable urge to sit down on Saturday and barf our thousands of lines of bad code in it the way you might write a rambling post on tumblr.
2) understand problem decomposition: practice OOP for the broader application (you don’t need an OO language just use it to break the problem down, write UML if it’s your first couple times) and FP for smaller problems.
3) practice discipline. Clean your room, do your laundry, make your bed, wake up at the same time every morning, go for a walk every day, keep a house plant alive. It’s almost unbelievable how much this discipline with small things can make you more focused and less compulsive.