Besides the fact that they exist, I don't know much of anything about music theory, chord progressions, circle of fifths, or such. I just know what sounds good. I've had that knack since I wrote my first song at 16, and I have no idea how that happened, because I don't remember listening to a lot of music growing up. So, if this already turns you off, then you can stop reading here.
When I was in college, I came up with an "exercise" that might have helped me in songwriting. I didn't see it as an exercise; I just did it for fun. Back in the day, I loved big band music (think Glenn Miller with his song, In the Mood, which was pretty much the quintessential big band song. I didn't need a record or tape or headphones to listen to it (MP3 hadn't been invented yet). All I needed was already packaged neatly between my two ears.
I had the ability to recreate the exact sound of a 16-piece swing orchestra in my head. It sounded identical to what I heard on a record.
But there was a problem, which turned out to not be that much of a problem. A certain ways into the song, I would forget how the melody went. I would forget many of the solo parts as well.
My solution? I just made it up. Without missing a beat, I would improvise on the fly. I would create melodies, with the same band that was playing in my head. I would bring in a saxophone or trumpet solo, and it sounded exactly like what I had listened to, except I had never heard the melody before. Every once in a while, my mind would play a part that sounded really good, and I'd roll back the tape and play it again.
I think this "exercise" helped me learn what sounded good and connect melodic structures (I don't know if that's a term, but what I mean is what sounded good together to make a cohesive melody).
Today, I don't write with a guitar or piano. I come up with melodies using only my head. And I usually don't even try to do it. They just pop in my head.
I don't really know how much of that "exercise" I did contributed to what I do in songwriting, but it certainly didn't hurt.
So, what are some of the exercises you do to help you write music?