If I was to guess, it sounds like you gave it too much gas as you exited the corner and the rear slid out from under you. Common mistake.
If you're a beginner, when you encounter slippery surfaces, slow everything down and keep your inputs smooth. Keep your corner entry speed slow. Do all your braking in a straight line. Then as you round the corner, no brakes or throttle, keep a neutral speed. Try to keep the bike as upright as you can. As you exit the corner, add more throttle smoothly, avoid being choppy with the throttle. Any sudden inputs with throttle or brakes will likely result in the tires breaking traction which is no bueno.
As you get more advanced, you can lean the bike more and carry more speed in the corners by counter-weighting the bike as it leans into the turn, dirt bike style. This means leaning your body away from the turn, so that if the bike slides out, your body weight is right on top of the bike and the contact patch of your tires, instead of inside the turn.
If your body weight is inside the turn when the tires lose grip, it'll make the bike slide out from under you that much faster.
If your body weight is over the bike and tires when you lose grip, you can ride the slide out. In the dirt, this is super fun, goosing the throttle and power-sliding the rear out of corners.