If your vessel is in distress, it is your responsibility as the master to do everything in your power to save everyone onboard.
Call 112 and request maritime rescue.
If you come across another vessel in distress, you are obliged to offer your assistance in the rescue mission as long as it doesn´t seriously jeopardizing your own safety.