H. pylori is not an STD. Most people get the bacteria as children, and don't know until they are older and develop symptoms. No one is quite sure how it's transmitted, but it may be saliva, vomit or fecal matter (that's poop).
https://www.mayoclinic.org/diseases-conditions/h-pylori/symptoms-causes/syc-20356171
You don't need to do a thing unless you ever get symptoms.
And who is telling you all these things? If an ex called you about h pylori, that's really strange. No one has ever considered that an STD.