You don't actually have to have that much sex to relieve your anxious woes, either. According to a study by UK pharmaceutical company Superdrug, people who have sex nine times per month self-report being "not stressed at all". Those who have sex six or less times say they are more likely to be extremely stressed.
Nine times a month is roughly twice a week. I can say from personal experience of someone in a long-term relationship, if you can make the effort to have sex twice a week, almost every week, your entire life will work just a little better. Problems seem less insurmountable when you're climaxing twice-weekly, and completely getting out of your own head. Even if it's just for a few minutes.
The positive effects of sex, particularly for women, are felt into the following day. An Arizona State University study of 58 middle-aged females found that sexual activity with a partner was a core predictor in lowering negative mood and stress, and a higher positive mood the next day. Funnily enough, the same study also found sex leads to less stress, and less stress then leads to more sex.
Sex is the anti-stress gift that keeps on giving. Once you're having regular sex a few times a week, your cortisol levels are lowered in general. This gives you more ability to handle stressful situations and events as they arise. Put simply: your responses and reactions to stress will also change for the better if you're having an orgasm or two now and then.
As a stress management tool, sex is some of the most economical and easiest therapy you're going to get. You don't have to pay for a fancy membership at a yoga club or even subscribe to the latest revolutionary mindfulness app.
Sex is free. You don't need any tools or special shoes (unless you want them, of course). Though I'm hesitant to call it exercise, it gives you the same endorphins as going to an expensive gym, with the added bonus of giving you the high that comes with social contact.
The feel-good hormones your body releases during sex (e.g. oxytocin, aka the "love drug", and dopamine) temporarily help you with other mental health problems as well. Sex cannot be considered a cure for anxiety or depression, but it does improve short-term symptoms of such issues. This can be particularly helpful because sometimes, when struggling with anxiety (as I have) or depression, the best possible thing for you is a short break from it all.
All of this makes me wonder how masturbation factors in here if you don't have a sexual partner, or aren't having sex nine times a month. All of the studies I looked at have discovered that orgasming by yourself doesn't have the same high stress-relieving benefits as sex, but it can provide mild improvements. Middle-aged women, for example, don't see next-day mood enhancement with masturbation as they do with sex with a partner.
Though it's difficult to explain why, my theory is this: the aforementioned contact high from touching another person plays an even bigger part than just "getting off". Masturbation is still helpful in immediate stress relief, however, which is why you should never be afraid of it at the end of a bad day to help you relax and get to sleep. But if you really want to get your mood down from a chronic boiling point, you really need to try having sex every three or four days to reach the monthly benefit threshold.