A lot of things go into writing a song, but most of the time, it just flows, you don't even think about it. I think you have to find your style, and your niche for inspiration. A lot of songwriters write when they are stimulated, having a bad day, whatever inspires you. You have to not be afraid and just go along for the ride. With time, you are going to get better, and find your style, which is fundamental. The only thing I can tell you if you want to write songs, is to write, and don't think about time, don't put pressure on your shoulders. Best of luck.