To climb stairs, you have to swing the leg to get it onto the next step and then it’s a mixture of bending and stretching the leg (tapping the arrow/AD keys) and kicking out the lower leg to shimmy onto the next step.
A lot of it is trial and error, but once you do it a few times you start to develop a method.