A contract is an agreement or promise that the law can enforce. The law will enforce some agreements but not others. For example, in most places, if a parent promises to take a child to get ice cream, the law will not enforce that promise as a legal contract.
The legal rules about which promises are enforced by the law can be different in different places (or jurisdictions), but a contract is usually enforced only if it is made by people or groups who want it to be enforced and who know what they are doing.
Sometimes, a contract is written down and signed by the people agreeing to it, but it does not always need to be. People usually sign a contract when something important or costly is being done. For example, when people take a job, they will sometimes sign a contract with their employers. The contract will show what the person must do as part of his job, how much they will be paid, and so on. The person and the employer will sign the contract, and it will become a legal promise.
If someone breaks a contract, another person might sue him or her. In a lawsuit about a contract, the court will look at the contract, listen to what the people who made the contract say about it, and then make a decision about what the contract means.