Sexual activity, including masturbation, releases endorphins and oxytocin, which can help reduce stress and promote relaxation.