There are many ways to get out of a contract once you have signed it. Some of these ways will require you to pay damages to the other party. Depending on the circumstances, however, you may be able to get out of a contract that you have signed without paying any damages or by paying only a nominal amount.
Breach by the Other Party
If the other party seriously violates the terms of the contract--known as a "material breach" in legal jargon--then as long as you have not committed a material breach yourself up to that point, you may be entitled to release from your obligations under the contract. You may also be entitled to sue the breaching party for damages.
Breach by You
If you refuse to continue performing a contract without provocation by the other party's material breach, and as long as no grounds for revocation of the contract apply, then you may be liable to pay damages to the other party. The amount of damages will be calculated not according to how much the other party lost by performing the contract, but by how much the party would have profited if the contract had been performed. In some cases this amount may be nominal--for example, if you agreed to paint your neighbour's house for £520, and your cancellation caused her to hire another contractor for £533, you total liability could be as little as £13. In the case of a real estate transaction, however, you might be ordered to transfer title to the buyer.
Grounds for Recission
Under certain circumstances, the contract may be rescinded without either party being held liable. The most prominent grounds for this include mutual mistake of fact and destruction of the subject matter. An example of mutual mistake of fact would include the situation where the contract was for you to paint Fred's house. Fred had two houses, and you thought you were supposed to paint one house while Fred thought you were going to paint the other. An example of destruction of the subject matter would be if Fred's house burnt down before you could paint it.
Examples of void contracts include contracts with illegal subject matter, a contract to sell illegal drugs, for example, and agreements to perform gratuitous acts, or without compensation, such as a promise to give a birthday gift. A void contract is treated as if no contract ever existed in the first place.
An example of a voidable contract is a contract with a person under 18 years old. A voidable contract in which a minor is a party may be repudiated by the minor, but not by the other party. In other words, if you sign an agreement with a 16-year-old and breach it, she can collect damages from you--but if she breaches it, you can't collect damages from her. This means only that you are entitled to no profit from the transaction, but rather only the amount necessary to put you in as good a position as you would have been if you had never signed the contract.