A Credit Default Swap is an agreement between two parties in which a protection buying party pays a premium to a protection selling party; in return for this premium the protection selling party will pay the protection buying party a specified notional amount if a specified credit event takes place in a specified time period affecting a specific debt instrument (called the reference entity).
Credit events include bankruptcy, bond default, or debt restructuring.
Buying a CDS means buying credit protection and paying the premium.
Selling a CDS means selling credit protection and receiving the premium.
Physical CDS Settlement: CDS buyer delivers the referenced entity (ex. transfers bond ownership) to the CDS seller and the CDS seller pays the notional amount to the CDS buyer.
Cash CDS Settlement: CDS seller pays the net difference between the notional amount and the market value of the referenced entity (ex. the defaulted bond may be trading for some small fraction of par on the market).