If writing to a limited timescale I tend towards a couple of starting point…
One is to play along to a rhythm (loop, organ preset, something in my head etc.) and see what I come up with - a bassline, lead melod, riff, a few chords etc. The other is simply to vamp around with a piano or electric piano patch and discover where that leads to.
The next step is deciding on a song structure - number of verses, where a chorus may go (if stage one has produced a chorus idea!), if there will be any bridges or middle eight or room for an instrumental break etc. I might play with the length of any of these parts too. I’ll then write lyrics to fit that structure - which provides a bit of focus for me.
Lyrical ideas could come from anywhere - lines in books, photos, places I visit or go through (provided I’m not trying to write a song in a day!) are often catalysts but once I get going I’ll be able to determine what Nile Rodgers calls “the dna of a song“ and try to ensure I keep the key theme of the song running to its end.
I‘m not sure how helpful this is to anyone, but it seems right not to keep it to myself :-)