In terms of composition or writing the music; I usually will noodle around on my guitar every so often until I stumble across across an idea that intrigues me. Usually it's just a couple notes in a particular order that sparks something.
Sometimes I'll play around with the settings on my pedal to emulate certain types of atmospheres or emotions, etc. Honestly, from there, it usually flows out once I get some traction. Once I get a pretty solid riff that I'm happy with, I'll plug into my DAW and record a scratch track to revisit later, or build off of.
When it comes to writing lyrics;
My absolute FAVORITE thing to do with music is tell a story or try to invoke/portray an emotion. The EP I'm working on, which started out as an instrumental, relied heavily on building a story through the music.
When I'm writing lyrics, I either close my eyes and listen to the song and try to write something that tells a story that fits the vibe of the song OR I'll already have a story in mind that I want to tell and will work on piecing it together. I like trying to find a balance of, "this is clear to ME what the story is" and it leaves enough vagueness for the listener to interpret their own version of a story.
I don't know if that answers the question the way you wanted, but I hope that resonates with some other creatives on here :D