One of the most valuable lessons I learned on my own is to respect the three pillars on which a good song is based.
My songwriting approach incorporates those three pillars into a process.
The guitar is a great instrument to write a song, because all of those pillars can be incorporated into your songwriting process: Harmony by chords, rhythm by the strumming pattern that you chose to play and melody by playing melody lines on the guitar and later by singing.
I always follow the order above when I start to write a song on the guitar: First working on harmony, then rhythm, then melody (vocals).
Sticking to this process has made writing songs on the guitar much easier for me.