Listen to the song's rhythm several times. If you are trying to figure out a complex rhythm, listen to it in sections. Listen until you can hum along with the song.
Clap or tap the rhythm as you listen to the song. If you know how to notate music, it may help to write down the rhythm.
Count how many beats there are in a measure. If you find yourself counting one, two, three, four, then there are four beats in that measure. Make your rhythmic playing fit within that one-two-three-four space.
Use your fretting hand to damp the strings so you don't have to worry about playing the right notes, then concentrate on playing the rhythm with your strumming hand. Don't play the chords until you can play the rhythm without thinking about it.
Use a metronome to make sure you are playing in the correct rhythm. Metronomes are available at music stores, but if you don't want to purchase one, there are several free online metronome programs.