i’m not pregnant right ?

Can you still be pregnant if you had sex and got your period 3 weeks later? I believe it’s safe to assume I’m not but i saw people posting how they got their period and found out they were pregnant the next month. I’m just having crazy anxiety