Consideration is the concept of legal value in connection with contracts. It is anything of value promised to another when making a contract.
An agreement made without consideration is void, unless–
It can take the form of money, physical objects, services, promised actions, abstinence from a future action, and much more. Consideration to create a legally enforceable contract entails a bargained for, legal detriment incurred by the promisee OR a legal benefit to the promisor. Under the notion of "pre-existing duties", if either the promisor or the promisee already had a legal obligation to render such payment, it cannot be seen as consideration in the legal sense.
In common law it is a prerequisite that both parties offer consideration before a contract can be thought of as binding. The doctrine of consideration is irrelevant in many jurisdictions, although contemporary commercial litigant relations have held the relationship between a promise and a deed is a reflection of the nature of contractual considerations. If there is no element of consideration found, there is thus no contract formed.
However, even if a court decides there is no contract, there might be a possible recovery under quantum meruit (sometimes referred to as a quasi-contract) or promissory estoppel.
If A signs a contract to buy a car from B for $5,000, A's consideration is the $5,000, and B's consideration is the car.
Additionally, if A signs a contract with B such that A will paint B's house for $500, A's consideration is the service of painting B's house, and B's consideration is $500 paid to A.
Further, if A signs a contract with B such that A will not repaint his own house in any other color than white, and B will pay A $500 per year to keep this deal up, there is also consideration. Although A did not promise to affirmatively do anything, A did promise not to do something that he was allowed to do, and so A did pass consideration. A's consideration to B is the forbearance in painting his own house in a color other than white, and B's consideration to A is $500 per year.
Conversely, if A signs a contract to buy a car from B for $0, B's consideration is still the car, but A is giving no consideration, and so there is no valid contract. However, if B still gives the title to the car to A, then B cannot take the car back, since, while it may not be a valid contract, it is a valid gift.