Why is it that every time I try to heat raw milk in a microwave it curdles and becomes like ricotta after a few seconds?
The problem you are facing is that your microwave temperature is too high and boils your milk too rapidly. The microwave does not heat food evenly and boils the milk too fast. Milk shouldn't be boiled too rapidly and doing this causes the casein in it to clump together and that curdles the milk. It should instead be brought 'to a boil' by heating on a slow heat for longer until it starts to boil.
So, you can try a couple of different options:
You can bring the milk to a boil in a pan on a stove on slow heat, which will take long depending on the amount of milk. And I can vouch for this method. I've seen my dad do this for years and as long as your pan is clean and the heat is low, you'll have a successful result.
I haven't tried this myself, but you can
Pour milk into a microwave-safe container and microwave on medium-high (70%) power, stirring every 15 seconds, just until steam begins to rise from the milk. To scald milk for custards or yogurt, heat 250 mL (1 cup) on HIGH for 2 to 2 1/2 minutes.- Reference