Can I avoid bleeding during sex? Period just ending

I’ve bled twice when I had sex about 2-3 days after my period ended. I’ve bled once from having sex without any period right before or after and I’ve bled once from just getting fingered right after my period (2 days later).

My period is basically done now, it’s the last day but I just see some spotting. I might have sex in 3 days and don’t want to bleed, what can I do?