How do I make a character play a certain animation when I perform an action?

The title says it all. I’m trying to only get my character to play the walking animation when I’m holding W, the strafe animation when I’m holding A or D etc. Can anyone help?

This topic gets covered in Epic’s third person tutorial.
https://docs.unrealengine.com/latest/INT/Videos/PLZlv_N0_O1ga0IoRrpI4xkX4qmCrhGu56/hRO82u1phyw/index.html