A magnet can be demagnetized in the following ways :
1. rough handling
2. hammering the magnet several times.
3. passing an alternating current around the magnet.
4. dropping the magnet on the floor several times.
5. heating the magnet to a very high temperature.