Stanford Medical School professor Andrew Huberman clearly explains how sex and ejaculation affect testosterone levels. Spoiler alert: Partnered sex increases testosterone. So does sex without ejaculation (Synergy).
Ejaculation itself releases prolactin, which suppresses desire for a time.