It is a mitzvah to put up a sturdy guardrail at least ten tefachim high
(about forty inches) wherever there is a danger of someone falling. One
also may not keep a dangerous animal in his home (Kesubos 41a).
Checking on safety measures regularly is an ongoing fulfillment of this
mitzvah (Sefer HaMitzvos HaKatzar, aseih 75).
The Sefer HaChinuch explains that although everything is in Hashem's
hands, we are obligated by the Torah to live in a healthy and safe way.
One may not act recklessly and risk danger.
The Rambam calls this section of halachah "The Laws of Murder and Guarding
Oneself" because a lack of safety is a form of carelessness which can lead
to murder, chas veshalom. Just as one is forbidden to murder
others, one may not allow dangers that can lead to people suffering. (See
our book Treat Yourself Right [Targum / Feldheim, 2001] on this topic.)