A smart contract is a contract that is enforced automatically. Smart contracts are written as computer programs.
These program identify in what situation what transaction must take place. Smart contracts can be enforced either by a centralized authority, or in a decentralized network, such as a distributed blockchain.
I will first explain fundamentals of smart contract and then I will overview some practical examples.