A difficult task - but the only fix for the problem. I venture to suggest that nobody in their right mind, goes around shooting people. And guns are the only tools designed specifically for mass killing.
Improving mental health, coupled with psych tests prior to granting gun licences would be a good start.
Major penalties for any person found in possession of an unlicenced weapon, would help too.