How to practice the hammer-ons and pull-offs
Pick the first note, then hammer the next finger down hard enough to make it sound without picking. A pull-off is the reverse: pull the finger off sideways so it plucks the string.
Legato notes are quieter than picked ones. Aim for every note at the same volume, and slow down until they are.
Keep the lower finger down while you hammer above it, so the pull-off back has a note to land on.