The hammer-on is accomplished when you pick a note and then using another finger hammer down on the same string. The sound of the hammered note is less pronounced than the picked note. For example place your first finger on the 5th fret of the 3rd string, and the hammer down your third finger on the 7th fret of the 3rd string. Don’t use your just quickly strike the second fret position with the tip of your 3rd finger. This would be described in guitar tab as 5h7 or 5 hammer 7. Keep your first finger on the 5th fret because you are going to pull-off of the 7th fret in the next example.
The pull-off results when you release a plucked note with enough force such that the second fretted note rings. This may require a slight side way motion to create enough friction to cause the string to ring out. The sound of the pulled-off note is less pronounced since you aren't using your pick to create it. This would be illustrated in guitar tab 7p5 or 7 pull 5.
If you combine these techniques you can create very fast note runs or licks. Imagine how this sequence of hammer-on, pull-off’s would sound when played very quickly 5h7p5h7p5. In deed the hammer-on, pull-off technique is the cornerstone for legato and most speed playing techniques.
It takes time to perfect the technique but it is worth the effort.