A coffin (also known as a casket) is a box used to store dead bodies, either for burial or after cremation. Coffins used after cremation are what is known as an urn, where the ashes of the person are stored.
The word comes ultimately from Greek kophinos, a basket. In English, the word was not used in a funeral sense until the 1500s.
Any box used to bury the dead in is a coffin.
The main distinction between a coffin and a casket is the shape. A casket regularly has 6 – 8 sides while coffins have a rectangular shape.