Well, here's the bad news: There's no set way. Sometimes people start with a basic chord progression, sometimes they start with a bassline, sometimes they think of a melody, and sometimes they start building up a drum loop and work on top of that! It's all about what inspires them at the moment.
Here's the good news: Every single song you've ever loved is an open book waiting for you to read. Referencing tracks isn't just listening to them and dragging them into their D.A.W.s, it's about a whole new type of analytical listening. You're no longer a fan, you're a student. I've attached a little PDF that has a good list of questions to take with you every time you listen to a track from now on. Start answering the questions as you listen to the song over and over. Do you notice any similarities between the tracks? Are there any trends that seem to emerge? Are certain sounds louder than others? What sounds did they think was the MOST important to hear (the sounds that feel like they're on top of everything else)?
The reason why the top-level producers often hesitate to talk about this kind of stuff is because no one wants to hear "It's a lot of work." But don't worry, because there's plenty of resources online to jump start you.
I'd watch
this Q&A session with NGHTMRE and
this SeamlessR playlist and see if it helps you any. The MOST important thing to remember is that when you're first starting out it is quantity, not necessarily quality, that you're looking for. The only way to truly know what sounds good is to make a lot of stuff that sounds bad, after all. Every time you force yourself to make a song, you've learned something new so that the next time, that part isn't so hard.
Don't give up!
EDIT: Attaching a picture of the PDF so people can see it without having to download