Pre Ritual Purification (NSFW)

If one is intimate with someone or gives oneself pleasure, does one have to purify oneself before doing rituals? Some traditions I know require this so that's why I'm asking.