Optimize Facebook and Twitter in the head Tags

I've taken a look at Open Graph and Twitter charts, but I still do not understand exactly what I need to do.

Can any one bring me kindly into the process of integrating a Twitter and Facebook page with a website?