From other countries that have regulations: prevent known criminals, known serious mentally ill people, known abusers, from having guns. Enforce gun lockers, and responsible ownership. Enforce education and training.
Most countries still have guns you know. Even just the gun lockers would prevent the us rampant murdering toddlers.
If you compare with excel or similar. They do not write excel the program. But there is a lot of tinkering with algorithms and functions to get the wanted results.