I’ll address masturbation.
Jewish doctrine has a thing about intentionally wasting the male seed. This is a big no-no with them. I’m not sure how thay feel about female masturbation.
In Protestant doctrine it is discouraged in many ways and many places in NT, such as Matt 5:28 which describes “adultery of the heart,” e.g. fantasizing about other people than one’s spouse. I suppose one is SOL if they have no spouse. Onan kept getting in trouble with God because he kept spillng his seed on the ground so much that an archaic word for masturbation is “Onanism.” Noah got in trouble with God because of masturbation an other sexual acts. I’ve noticed in the last few years, many Protestant sects have relaxed their taboos on sex in general, in practice (but somebody forgot to re-write the texts to support this)—as have all the religions
Catholic doctine is similar because sex is only allowed for procreation purposes, so masturbation is considered a mortal sin in that respect. This goes for both men and women. Then there are a plethora of lesser sins involved simultaneously in the same act, such as having “impure thoughts”, adultery of the heart, lust, vanity, self-gratification, etc., etc. So, one act can pretty much send you down the tubes if you die before confessing to a priest and receiving absolution. My guess is that, because of this, Hell is a lot more crowded with pubescent youth than people realize. LOL.
In Islam, only mutual masturbation between a man and wife is allowed. .Again, if there is no spouse, the person risks iniquity.
Those are the only religions/cultures I’m familiar with as far as masturbation and I’m pretty sure that most members of the religions above no longer take much of that stuff seriously anymore. I have no idea how the Asian religions feel about it.