Plan B

How effective is plan b if I take it 12 hours after unprotected sex?? My doctor said I should be okay but I’m still going to want to take a pregnancy test in a couple weeks. I’m terrified, I’ve never had to take plan b before.