I recently purchased a Corny keg and was wondering If is necessary to take the whole thing apart for cleaning or could I just remove the lid and clean that way.
If it's used, it's best to disassemble, clean, and sanitize everything as Greg said. It also lets you inspect all the o-rings and gaskets. It's usually a good bet to get a new gasket set whenever you get a used keg. Most of them saw soda beverage service at some point and the o-rings hold the flavor/aroma. It also gives you good practice of how to disassemble/ assemble your keg.
It's not as bad as you think. Also when re-tightening the posts you don't need brute force, just turn your wrench till it gives resistance, then just torgue a bit beyond that.
Here is a good link to how to disassemble and re-assemble kegs.
When i was a newbie. I only use pbw. No Sanitizer. Now i use starsan. Never had a bad batch of beer. We use cleaner and Sanitizer to reduce the chances