So take the pill the night before and right after?
I hate to be the bearer of bad news, but in order to avoid pregnancy, the most effective way is to NOT HAVE SEX.
First off, the first time for a woman can be slightly painful depending on the man's size and whether the hymen has been broken or not. Expect a little pain for the first time, and thank God if it doesn't.
Secondly, the morning after pill is very effective if taken after sex the night before. However, keep in mind that this pill is abortion because it kills the child that you just created. If you support killing children, then use it as you wish... but keep that on your conscience.
Thirdly, I don't know your marital status, but I'm assuming you're in middle school or high school. Don't have sex before you're married! You will regret it. Whenever you do get married, you get to tell your partner that you didn't love them enough to wait for them. This probably won't be your favorite moment in life...
Good luck. I hope you make the right choice for your future.