Slashing is a means of ensuring good behaviour within the validation process of PoS blockchains such as Ethereum. Slashing refers to the irreversible penalties that actors can face should they behave in a manner that is harmful to the network. It is one of the functionalities of PoS mechanisms that has allowed them to function effectively.
Slashing is fairly rare and only occurs when actors commit certain offences: proposers signing two different beacon blocks for the same slot; attesters signing an attestation that “surrounds” another one (this creates a contradiction to what a validator has already said was finalised in a previous attestation) and when an attester signs two different attestations with the same target. To identify these offenders, you need validators known as “whistleblowers” that monitor this kind of activity. It is important to note that although inactivity can result in penalties, it does not result in slashing.
Penalties include permanent eviction from the network and substantial losses in staked tokens. Staked tokens are gradually drained until the offender is evicted and labelled “slashed.” As eviction is permanent, one can only become a validator again by producing new validator keys and fresh stakes.