Animate character grabbing a ledge?

Hi, I am wondering, how do I go about making an animation where your character can grab ledges and pull themselves up? I would like to do this with a FPS. I know how to make basic animations, I just don’t know how to make the character grab the ledge? If that makes sense.