how to add a Pledge to contact
Did you read the manual before asking this question?

As per my reply here 

CiviPledges can be set up so that


a logged in contact can see their upcoming Pledges on their dashboard
a contribution page can be set up as a self-service payments page


Setting up a pledge is here 

The contacts Dashboard is here 

The self-service payment is here but will only show if 'demo' contact has a pledge set up

If you need to add a Pledge to contact called 'demo' you can do so here

Hope that helps you.