Wild Magic is a Sorcerer origin whose magic is unpredictable. In the 2014 rules, immediately after you cast a sorcerer spell of 1st level or higher, the DM can have you roll a d20; on a 1, you roll on the Wild Magic Surge table — a d100 list of 50 random effects — and the result happens right away.
Effects range from harmless to chaotic: a fireball erupting centered on you, regaining expended sorcery points, casting a random spell, your skin turning blue, or a duplicate of you appearing. Surges are limited to one at a time, and the feature also powers Tides of Chaos, which grants advantage and can force a surge.
The 2024 rules rework this: surges trigger more reliably — for example, right after you use Tides of Chaos — and the table itself was updated. Check which edition your table uses, since it changes how often the chaos actually shows up. Roll the percentile die with the d100 dice roller.