Hi there! time to put up some advise and humble knowledge, you know share my thoughts on this topic, now I'm going to talk about some advises or as I call it, "Hacks" of creating/writing music. They had work for me, and I know it will for you (hopefully).
Let's get down to it:
1- STOP listening music for a moment.
Yes, believe it or not, this can cause problems on the moment of writing, if you decide to write a song, try stop hearing music for a moment. Why? Because if you are listening to band A or band B or anything, your muses or inspiration will be printed on the material you are writting, or at least you will be "forced" mentally to do so, "Ohh I want to write and compose something like this", and this is bad, at the end you will found yourself "copying" a lot of things, is not bad that you have your influences and all that, but stay close to your guts and in what you have learnt through the years, I know that you are fascinated and listen to music everyday, so why not stop for a moment, and then write?, believe me this is very helpful.
2- Play your instrument/instruments alone.
This is one that works for me every time, I take an hour or so playing an instrument, and this is NOT schedule "practice" it's just all out playing, can be a guitar, piano, playing with FX's, Patches, I mean, sit with an instrument for a while and just start playing, you will came up with interesting things, what happen is, that you are there playing "something" and after that everything else starts to flow, naturally you can came up with cool riffs, chords progressions, structures, ideas, ANYTHING! And all this is useful, maybe you can come up with cool stuff others not so much, but hey, keep doing it, not every song that you write is gonna be a great EPIC, so practice, writing is something you must practice just like finger exercises.
3- Record yourself
"All ideas most be printed" as I say, it can be a melody, riff or something that "came up" in your head, this happens a lot, and it can happen very spontaneous, so pick up your smartphone or your DAW and record it, it can be your instrument or your voice "humming" the thing. Muses come and go, when I take a stroll or a walk to my job this is a very productive and creative moment for me, I came with almost entire albums in my head!, so remember this, try to capture those moments of creative glory!
4- Play with other musicians
Playing with other fine musicians or jamming along with them can generate a tons of musical ideas, in my case, I love to jam along with just a drummer, it's incredible the ideas and riffs I can pull out in that moment, so if you are a good drummer and you are reading this, I hope that I can play with you one day!, but beware of my ideas!! they're crazy sometimes!
5- Open your ears!
This one is the most important, open your ears every time, try to listen things that is NOT music to inspire you, it can be anything, from the sound and rhythm of brushing your teeth to the drops sounding in your kitchen sink! I remember myself writing a whole song and it starts with the sound of a big truck horn crossing the street of my house. So try to inspire yourself with ANYTHING, distant music, distant sounds, bird sings, I mean anything, you know that we musicians, suffer from a great sickness, which is as I call it: "The Creative Block Sickness" which is that your muses get killed by a bacteria called "inspiration-less".
Try this advises and see what they can do for you!
Hope it works!
God bless you all!