You can't turn your Sim into a warlock in The Sims 2. That's a class from World of Warcraft, not something available in The Sims series, so you'll need to enjoy spellcasting in a different game.