Rather than installing a crack, the best way to enjoy The Sims 3 is to buy it legitimately.
Cracks and key generators are illegal and are a very common way to infect your PC with malware. You can pick up The Sims 3 and its expansions through official channels like Origin/EA or trusted retailers, and it's frequently discounted during sales.
Installing a genuine copy also means reliable updates and access to official content.