Make it way harder to get access to guns is one way for sure, but that seem to be a hard limit to lots of americans it seems.
So sadly I guess that you simply need to spend more money on mental healtcare and/or accept the fact that it happens?

yes that is VERY cynical but without easy access to weapons then it simply wouldnt happen or atleast way more seldom.

my deepest condolences to those affected is there for sure in any case.