Do I need to buy Mac OS X again?
I would say the best option might be to get software like Carbon Copy Cloner or use Disk Utility to clone the existing drive to another drive / external drive.

Then you could clean off the files on that OS and test that booting to it still works. Once you have something that works - you can re-clone or repeat the deletions on the main drive.