Hello Aarushi, thanks for messaging!
I'm really sorry to hear that you're struggling with these obsessive thoughts, and it's so great that you're doing your best to take care of yourself and resist your compulsions. While only a therapist can talk you through these thoughts and help you find coping strategies that suit you best, it might help to start by calming yourself the minute these intrusive thoughts about being pregnant hit you, using mindfulness apps like this one-- https://my.life/
(have you used these before? Do they work for you?). You could also limit sexual contact for some time, in case you haven't done so already. Have you thought about what the underlying fears behind your pregnancy anxiety are? And would you be comfortable sharing? Talking through those underlying feelings might feel freeing.
Here's an article that may help with the pregnancy part of your anxiety: https://www.scarleteen.com/article/bodi ... nk_you_are
Here's an article to help with the intrusive thought part of your anxiety:https://www.bustle.com/p/how-to-actuall ... ts-8800188
Let us know if these help, or if there's anything else you need.