Determine the key the music is in first. Play the song through a speaker and attempt to accompany it with major chords. If the major chords sound distorted with the music, or extremely out of tone, the song is in a minor key. If not, the song is in a major key.
Play a few chords in the correct key along with the song and attempt to emulate the pitch. Choke up on the guitar or go higher on the keyboard if the song is primarily high notes, or down if the song is in low notes.
Play an E chord (or E minor if it is in a minor key) in the pitch range of the song. From the E, raise the chord to an A, or lower to a G chord to match the first chord of the song. Continue this method for each chord. Play and follow along with the song several times to find the chord progression.