Dear Student,
Answer to your question is given below:
Magnets can lose their magnetism if they are dropped or banged on enough to bump their domains out of alignment because of the way vibrations propagate in the material. Very sharp impacts jostle a magnet’s atoms, causing them to realign with respect to one another. The atoms of the magnet will realign in random directions, weakening the magnet. Most permanent magnets can hold up to being dropped a few times, but it will lose strength from repeated strikes with a hammer.
Regards,