One way to keep a magnet from losing its magnetism is to place it in a strong, metal container. The container should be able to hold the magnet securely, and it should not be moving around too much.