Learn as many chords as you can and see what they sound like when you change from one to another. If you don't know the natural progressions you can sometimes come up with some very interesting sequences.
A standard rock n roll sequence is E-E-A-A-E-E-B7-A and back to the begginning but if you start substituting the minor sequence ie C#mx2-F#mx2-C#mx2-Ab7-F#m you get a completely different feel. Then if you mix the 2 up an even more interesting feel: E-C#m-F#m-A-E-C#m-Ab7/B7-F#m/A. Most of it is trial and error ... the other half of it is the rhythm in which you play the sequence.
Chords are great and very often you can manage to pick the melody out of the sequence and before you know it you have written a song.