Like soy and other non-dairy milk, oat milk can separate and sometimes look "bad" or spoiled when added to a hot ingredient.
Assuming the "Sell by" or "Use by" dates have not passed, the key to stopping this is to temper the milk as you add the hot substance.
For instance, if you're using a Keurig, add the milk and any sweetener to your cup first, then place the cup in the proper position and hit "BREW."
If you pour hot water, tea, or coffee from a carafe directly into your cup, add the oat milk or other non-dairy milk and any sweetener to the cup first. Then, while stirring, slowly pour a few tablespoons into the cup to bring the milk to temperature. Finally, pour in the remainder of the hot liquid.
Always shake the oat milk container before use to eliminate any natural product separation within the carton.