VirginaK's suggestion of keeping a notebook with everything is great - I also have folded pages of paper and a pencil on me when I can't have my notebook. The more you get in the habit of jotting down phrases or even just words that somehow resonate in your imagination, the easier it becomes to use these seemingly stray ideas.
Angledawg makes the point that a passion for writing is important - exercise that passion by writing every day. Make it a point to set aside time to flex your imagination every day. Once writing songs (or fiction, or poetry, or limericks, or whatever) becomes a part of your daily rhythm then your creative urges can really blossom.
Writing songs is fun - I wish I had started many years ago, but I just finally decided to get serious about it (meaning do it every day) in the last couple of years. James