I find it useful to consciously take 1 of 2 approaches...
1 - just write what comes out
This is what people refer to as "writing from the heart" - do not get "tied down" by genres, styles, approaches - just write and record whatever comes out and let the subconscious dictate the style (which will inevitably be shaped by your influences in one way or another)
2 - pick a genre / style / brief to write to
This is where you can sit down and decide you want to write a pop, rock, blues, dance, hip hop etc. track
You might approach it by listening to a song you like and "emulating" the style, production, approach etc.
You might even want to write commercially and follow a "lead sheet brief" - which is not as easy as some people think
These approaches are not mutually exclusive and may morph in to each other - OR, you might hit on the "holy grail" of writing a song from the heart that fits a brief and has commercial success or critical acclaim
However, both approaches mean you just need to WRITE so I would say just crack on with the writing and worry about genre later (or not at all!!)