This, for sure. To take it a bit further, where can you get it?
Brian Eno mentioned in a recent interview that he has thousands (!) of unfinished works sitting around, and the only time he finishes any of them is when he has a deadline to meet. I smiled when I heard that. I earn my living as a writer and I’m constantly on deadline. It teaches me to set a goal for every session I spend with my gear. Sometimes it’s sound design or improv; others it’s sketching or polishing a composition. The more you practice any of these, the better you get.
Once you’ve got your focus, how do you learn to structure?
A few good ideas above already (Tarekith’s guide etc.) … but as it depends on what kind of music you want to make (which may not be the clubby stuff I do, for example), try developing an active critical ear. Spend a good amount of time listening to music in the styles you want to write in. And do it actively: listen to one piece repeatedly, identify what you’d consider its sections, and describe to yourself how they are distinct from one another and how they flow from one to the next. You’ll probably notice some common tricks different composers have used and you can try your hand at them. After awhile you’ll likely get bored of painting by numbers and your imagination will kick in.
Keep listening this way though. Try to get something out of every track you hear – even if you don’t “like” it per se. You can turn on your analytical side even if you’re not engaging with the music emotionally … it might even be better that way. You can start saying to yourself “Now if I had written a track like this…” and then you can go do it properly.