Just by doing it, really. I started with music when I was younger and just built on that over time. It's something you just have to learn. However, that doesn't mean you can't learn it quickly. Let me try to lay some groundwork for you. I reserve the right to lie to you if something is exceedingly technical or there are unnecessary details to basic understanding. I'll tell you when I lie, but don't get caught up on it. It's not important unless you want to get deeper into theory. Vocab words are in bold. Knowing them makes talking music a lot easier.
MOST BASIC OF BASICS OF MUSIC THEORY
There are twelve (12) total notes (lie): A, A♯/B♭, B/C♭, C, C♯/D♭, D, D♯/E♭, E/F♭, F, F♯/G♭, G, G♯/A♭. These notes make up every single scale (lie), major, minor, pentatonic, blues, chromatic, etc.
A ♯ symbol means the note has been raised by half a step, or moved one note upwards in the twelve (12) notes. A ♭ symbol means the opposite, the note has been lowered by half a step. Take note that if you take two adjacent whole notes and flat (lower) the higher one and sharp (raise) the lower one, you will reach the same note (with a few exceptions).
There are two primary different types of scales (lie): major and minor. Both contain eight (8) notes.
If you pick a random note, the intervals between notes of a major scale (there are seven intervals, making the scale eight (8) notes) would be a whole step, a whole step, a half step, a whole step, a whole step, whole step, and a half step. This can be written as W-W-H-W-W-W-H. For our purposes, a whole step is two frets and a half step is one fret. If you have a piano, start on middle C and play every white key until you hit another C. This is a C-major scale.
A minor scale is a major scale, but with flatted (lowered) third (3rd), sixth (6th), and seventh (7th) notes. That means, using our notation from before, a minor scale would be written as W-H-W-W-H-W-W. Go to your piano again and find an A. Now play every white note between that and the other A. This is what's called a natural minor scale. Natural because it is the same exact notes as its relative major scale.
If you've been paying attention, you'll notice that A natural minor and C major are the same scale, just started on a different note. This is what it means to be relative to one another. C is the relative major to A natural minor, and A natural minor is the relative minor to C major. Every major has a relative minor. If you look at the circle of fifths (http://en.wikipedia.org/wiki/Circle_of_fifths ) the inner circle is the relative minor of the outer circle.
Now besides the natural minor, there're a few variations. Take a minor scale and sharp the seventh (7th) note. This is what's called the Harmonic minor, and sounds very 'eastern' (think snake charmers). The next type of minor scale (Melodic) changes depending on whether you're ascending or descending the scale. If you're ascending, then both the sixth (6th) and seventh (7th) notes are sharped (raised). If you're descending, they're both untouched. Descending Melodic is the same as a natural minor scale.
There's also chromatic scale, which is every single note played one after another (it has 12 notes). It's meaningless to assign this to a single note/key, because every single key would consist of the same notes.
Enough about scales. Let's talk chords.
Look at a C scale (because it's simple and doesn't have any sharps or flats):
Make a standard chord (1-3-5 (it looks like a snowman on paper)) out of every single one of those notes on the scale.
"But Hats" you ask, "Why are some of the scales capitalized and some of them lowercase? And one of them is ITALICIZED! What's up with that?"
Funny you should ask that, astute and inquisitive reader! The reason some are different is because they are different types of chords. If you make a basic chord (using notes from the scale) out of every note of the scale, some of the chords will be major, some will be minor, and some (one) will even be diminished! This is a natural result of notes in a scale, and what it means when someone says that chords are in a key. Every single one of those chords is in the key of C-major, and could be played if you were playing a song in C-major without sounding really bad (although it might not sound great, the order is important). They are in the key of C-major because every note in the chord is in a C-major scale. If we were to assign a roman numeral to every chord we just made, it would look like this:
b-d-f vii[size=50]o[/size] (I don't know how to superscript, and for that I apologize. This symbol ([size=50]o[/size]) should be in the top right)
If you've ever looked at a generic chord progression, you should be hit with a wave of understanding right about now. This is the meat of songwriting: chord progressions. The roman numerals represent the same exact thing in every single (major) key. How you write a song is by relating the different chords to each other, and there are certain short patterns (called cadences) that work remarkably well. For example, play V-I (G-C in the key of C) right now. Hear how the V sounds like it's leading into the I? This is what's called a Perfect Authentic Cadence. It sounds heavy and final, and people love it. Pay attention to how many songs end like that, particularly in classical music. It's pretty common.
Now the same roman numerals in a minor key:
It should be noted that the fifth is often made major, although this is not a hard and fast rule. You're free to do that or not do that as you wish.
Now for a short explanation of what makes a chord a chord, just to help you solidify what's going on here. Definition: a chord is a collection of notes played at the same time.
A major chord is a minor third (a whole step and a half step/three half steps between notes) stacked on top of a major third (two whole steps/four half steps between notes). It generally consists of three notes, although you can repeat those three notes as many times as you want without changing the chord.
A minor chord is the opposite: a major third on top of a minor third. It sounds sad/pensive/thoughtful/angsty.
A good rule to remember: If you take the middle note of a major chord and flat it, it becomes a minor chord. If you take the middle note of a minor chord and sharp it, it becomes a major chord.
A diminished chord is two minor thirds put on top of each other. It is very suspenseful.
An augmented chord is two major thirds stacked on top of each other. This chord never appears naturally except in harmonic minor key. Otherwise, you have to consciously change something to get this.
So that's a pretty solid (I think) basis of music theory for songwriters, starting from the ground up. Using this, you can make any chord in any key, and can get a head start on writing your own progressions. The wiki page on progressions is a good place to get started on how to write a good progression, and with a little luck you'll be able to understand it (I don't get parts of it myself): http://en.wikipedia.org/wiki/Chord_progression . Moving on from here you can branch into a lot of different types of theory.
I am sorry for the essay. Hopefully it is moderately helpful.