One hack I saw on the interwebs is to fill an orange 5 gallon home depot bucket with dry sand and tape a target and label that says "safe direction." Effectively a cheapo gun clearing bullet trap that you can install in any room of your home where you clean or clear weapons or dry fire -- your garage, your office, your bedroom, etc. Unlike metal bullet catches/traps it also doesn't vaporize lead.
You can put targets on sides or top (install lids on them once filled, not leaving open sand) or both.
I always remove the mag, inspect visually to ensure the mag well is clear as well as the chamber and bolt face. If you can't see then check manually with your fingers, or even better, do both.
It's also why I try to keep slide locked back and magazine out after doing this whenever transferring guns between individuals. Or even when just displaying a gun in front of another individual. And then for new gun folks, I encourage them to do the same inspection before any further handling of a gun. It's not about lacking trust in the previous person, but taking responsibility for their own safety/safe handling of firearms since they're on the hook for their mistakes with a firearm, not the person who handed it to them.
I don't like folks "showing off" their guns around me while loaded, and if for personal protection sidearm or concealed carry, I think it's rude to ask them to disarm and clear their weapon so that I can have a look...
When dry firing at home, I also try not to have live ammunition in the same room, or at least keep loaded those mags out of the work and practice space secured in mag pouches, gun pouches, etc.
Accidents and accidental negligence happen. Murphy's law.
That's why following the 4 rules of gun safety are so important. You have to violate more than one of them for life-ending accidental bad things to happen.
Count your blessings. Move forward. And use your experience to educate others on the utmost importance of gun safety, just like you're doing here.
Especially these days, it takes a big man to admit to a mistake.