Pee after sex?

Okay so I’ve always been told to pee after having sex because bacteria can get in the urethra and cause a UTI. Do you have to pee immediately after sex? Do I just get up and pee and then come back? This is probably a silly question but I just wanna know what other people do.