Hi, I was on holiday at the beach, and the lifeguards took down the shark nets due to the sardine run, and told people not to swim, we went to a different beach and swam, are there any Halachik problems regarding putting oneself in danger?(swimming in a different beach was legal)
It is forbidden to do things that are recognized as being hazards and dangerous. Life is a great gift, and we ought to cherish it and guard it well. If the shark nets are essential for maintaining safety, so that bathing is forbidden without the nets, the principles should be adhered to.
For a detailed analysis on the halachic concept of looking after the body, please see https://dinonline.org/2010/07/23/preservation-of-the-body/.