Man I wish I knew it myself, it's very much a wildcard for me. Different approaches create different music.
If I start with a specific melody in mind, usually that melody is more or less present throughout the whole song playing nonstop, as if I can't let go of it.
Sometimes I create the overall song structure first with e.g. the drums and the bass, and then build everything else on that.
...Or maybe in a flow state I create a short musical doodle that I expand on later. Or just play random bullshit and see where it takes me, possibly fitting old ideas in there. This usually creates the most experimental and fun songs, which I like. I'm all about crazy music that breaks all expectations and genre limits.
Most of my music doesn't get past the production barrier. I love mixing and working in my DAW, but damn it's hard to to actually start tracking and putting the time in. But once I get over that hurdle, I hyperfocus on it and can't think of anything else.