There's no general method for making music (which is good; music would have been much more boring if there were). Instead, each musician has their own bag of tricks which they apply according to need.
Build up your bag of tricks by experimenting. Have separate sessions where you're just messing around with a synth until you get a cool preset which you then save. Write short melodic phrases and chord progressions and then analyze them. Alternately, read up on various techniques from music theory and sound design and try to implement them. Also, lift some ideas from music you like.
When it’s time to actually write a song, the bag of tricks will make the process much more streamlined. You can simply implement ideas you have already thought of previously. It's especially useful if you're under a time constraint, like during an XHB.