A contract is a legally binding agreement that creates rights and obligations that can be enforced in court. There are several key elements for a valid contract: offer and acceptance, consideration, intention to create legal relations, and capacity to contract. Contracts can be written, oral, or implied. They are either bilateral, with promises exchanged on both sides, or unilateral, with an action promised in exchange for a promise. A contract that is missing a key element may be considered void, voidable, or illegal.