If it's a precomposed walk cycle inside another comp or if its footage, the best way probably is to use the enable time remapping (layer/time/EnableTimeRemapping - ETR).
With this you can set keyframes on any frame of the animation, and the keyframe IS that frame. So you could set one keyframe when the left foot comes down and then set another when it comes down at the end of the cycle. You then extend the layer's length (which ETR lets you do) and then you can copy and paste those two keyframes anywhere you want down the length of the layer.
You could use a loop expression but that makes it harder to pause or ease in or bounce if you want your character to have a little less roboticness or if you want to speed up or slow down the motion (which you can do just by dragging the keyframes further apart. Want him to stop? No problem just make that keyframe a hold keyframe.
If the animation is a precomp there is no granularity to the "steps" so no matter how you stretch or ease the key frames the motion will always be smooth. If the animation is coming from another program as frames - try and render out a high FPS rate and then the ETR will have more frames to pick from when it starts scaling the speed.