There is no single "witch" cheat, but you can achieve a witch-like Sim through several methods depending on what you own and prefer.
This is the intended way to play a magical Sim.
testingcheats true.traits.equip_trait trait_Occult_Witch (or trait_Occult_Spellcaster).cas.fulleditmode, shift-click your Sim, choose "Modify in CAS," and add the Spellcaster occult type there.Many creators offer "Witch" or "Magic User" traits with custom spells, interactions, and CAS assets. Download only from reputable sites like Mod The Sims or creator Patreons. Place .package files in your Mods folder and enable "Custom Content and Mods" in Game Options.
With testingcheats true and cas.fulleditmode enabled, you can enter Create-A-Sim in-game and add any trait available (including modded ones) without starting a new save.
bb.showhiddenobjects cheat to access debug items like cauldrons.Note: You must own Realm of Magic for the official occult. Always back up saves before installing mods.