A hammer-on is simple technique of "hammering on"
the fretboard with one of your fingers to produce a note
instead of picking the note.
To perform a hammer-on place the first finger of your
fret hand on the D string on the 2nd fret. Play the note
then bring the 3rd finger of your fret hand down onto
the 4th fret. Do not pick this second note, instead"hammer"
it hard with your 3rd finger to produce the second note.
See the tab and audio example:
You get two or more notes for the price of one with a
hammer-on, because you only pick the note that precedes
the hammer-on note. You must bring your hammering finger
down hard, fast, and hold it down firmly to get a good
hammer-on note. In the audio example see if you can hear
the difference between the notes picked or the notes with
a hammer-on:
It may be difficult to hammer-on at first. You hand may
need a little time to build up enough strength to produce
an audible note with a hammer-on. Keep on practicing it
and you'll get good soon enough.