If you want to compose your own music, it can be very helpful to create a few "personal songwriting rituals" for yourself.
Anything that gets you into the mood and the right frame of mind can be useful. Knowing what works for you is the key. Some people like to write music free of distraction, in a quiet room with noone else around. Others enjoy sitting in a park with their guitar, and may enjoy being around friends while working on things.
It can be a good idea to develope a set of things you do almost every time you sit down to make music. This can be formal or informal, spiritual or silly, profound, profane, or all of the above. (Yes, that's possible.)
Jane sits down at her piano, pulls out some manuscript paper and a pencil, lights a candle on top of it to represent inspiration, and plays through her scales and exercizes before letting them take her someplace. Soon she's lost in new sounds, and writing something down in a hurry.
Billy stumbles out of bed, cracks a beer, and lovingly rubs the neck of his guitar. His notebook and pen are already on the floor in his usual spot.
Whatever little elements you can add to your routine of practice, playing, and creation that can happen in the same way most of the time can help create a "mental trigger" Jane's subconscious mind, where the creativity really resides, understands that it's showtime when she lights the candle. Billy knows that when he tastes the beer and starts idylly playing with his guitar, something will happen.
It's a process of creating a mental landscape that is open to the creative process. Try lot's of things, and feel free to comment here and let me know some of your favorite tricks to get into the mood. :-)