Most of the internal magnets in hard drives are NdFeB (Neodymium Iron Boron) magnets which are the most powerful permanent magnets currently available.
They aren't that easy to get at and are usually glued to metal "brackets" inside the drive. Even after you've removed the bracket/magnet assembly from the drive, using the magnets effectively generally means you'll have to remove them from the brackets. That can be tricky. The magnets are fragile so you can't usually just pry them off the brackets without breaking them.
There are a few ways I've removed them from the brackets, none of which are easy or particularly safe and all of which usually involve breaking a significant percentage of the magnets in the removal process, so I'll leave it at that.
A couple of cautions about rare earth magnets and guns.
It's not a super idea to have your gun or parts of your gun magnetized. Small bits of steel (like the normal products of metal-to-metal wear) will now stick to it. I do use magnets to hold some of my magazines to the safe door, but I try to alternate their position on the magnet each time I remove them and put them back. The idea is that they're not always lined up with the magnet's poles the same way in order to try to avoid magnetizing them.
NdFeB magnets are pretty fragile. They are sintered metal that is typically nickel plated to provide additional structural integrity and protection against corrosion. If you allow them to snap together or snap to a large piece of metal, they will often break. That causes a couple of problems.
First of all, you've ruined your magnet.
Second, a broken rare-earth magnet will often produce some very small pieces which are very tiny, very strong magnets which will stick to steel with impressive tenacity. And since each of the tiny pieces is a small magnet and the poles will be lined up in opposing fashion at the moment of breakage, tiny pieces can be propelled away from the magnet at a pretty decent velocity. Could be bad for eyes that get in their way.
Third, the nickel plating is very sharp since it's hard and very thin. It's really easy to cut yourself on a broken NdFeB magnet. And if the broken magnet is stuck to something you care about, it will be difficult to remove it without scratching what it's stuck to.
Fourth, without the nickel plating, the exposed sintered metal will oxidize fairly rapidly and gradually turn to powder.
Finally, it's worth pointing out again that these magnets are very strong. It's not hard to hurt yourself with them, particularly if you have ones that are very large or if you stack a number of the medium sized ones together. Be very careful with them, particularly if you're dealing with more than one at a time. They will snap together with surprising force if you let a couple of them get close to each other and if bits of you are caught between them when they meet it will be remarkably unpleasant.