1) Pregnancy happens when the sperms inside the semen meets the egg inside the womb. Even without ejaculation, sometimes, there can still be small amounts of semen left behind.
2) STDs happens when one partner carries a virus or bacteria that is spread by having intercourse. And the spread is by touching.
3) As you can see, both of these events are mutually exclusive, ie different from each other.
I hope you would be able to come to a conclusion now.
You could use a condom to reduce your risk of having a STD as well as have as few partners as possible.