Once you have the requisite technological advances, you can forge a military alliance with another Civ against a third. You contact them, select the Civ you wish to ally against, and make the offer. You may be required to contribute a lot of money to the enterprise, to convince them to join with you.
Upon getting such an alliance, you and they will immediately declare war on the third Civ (there is no option not to; the alliance is a declaration of war) and the alliance is expected to last at least 20 turns. If you make peace with your enemy before the alliance expires, it will cost you diplomatically.
A Mutual Protection Pact can be bargained for later on. An MPP is universal; if anyone attacks you, your MPP ally automatically declares war against the person that attacked you. And vice versa.
Now this doesn't count for declarations of war. If you have MPP with England, and then declare war on Russia, when Russia's turn comes and they attack one of your units or cities, England then declares war on Russia. If both you and Russia had MPPs with England, who ever conducts the first attack gets to lose the MPP. (In an earlier version of the game, such an MPP would cancel itself out until some one ended the MPP, but I think this was fixed.)
Even though this declaration of war is automatic, if an MPP is broken, expect diplomatic penalties.
What kinds of diplomatic penalties?
Others start disliking you.
They demand even more unreasonable exchanges than normal.
They may refuse to deal with you altogether.
They may declare war on you, or walk all over your territory, which causes you to try to kick them out, and then they just get pissed and declare on you.
Hope I've helped.