I am not a parent, so maybe don't listen to me, but if I were (especially to boys), I would try to deeply instill a value of responsibility into them.
Boys are naturally going to have a higher tolerance for risk, and that can be a very good thing, but it needs to be directed and they need to learn to differentiate good risks from bad ones.
But more generally, building up an identity of being responsible and showing what is expected of them as a child, family member, citizen, human being, etc. will hopefully mean they will do what needs to get done when it needs to be done. Try to get them to ask themselves "what's the responsible thing to do here" and "why is that the responsible thing to do".
idk, maybe that's super obvious. Sorry for posting my naive opinion.