Good on you for buying Windows 8.
But, to answer your question in a way that I think is better than previous posters:
1. DO NOT download a "cracked" version of Windows. This is your OS we are talking about here. Don't trust some 17-year-old script kiddie living in his mom's basement to modify that kind of stuff for you! You can download legit, unmodified copies of the install disks for FREE directly from Microsoft.
Windows 7 links are here, and information on how to get
Windows 8 disks is here.
2. You can either burn the images to a disk, or what I usually recommend, make a bootable USB drive. Doing the former requires burning software and (more importantly) a working disk drive. The latter can be accomplished with virtually no new tools by following
this guide (it works for Windows 8 as well).
3. Boot from your install media and put Windows on your machine. Choose "Advanced Installation" and delete any existing partitions on your disk. Then click "Next" and let the installer to its thing.
4. Boot up your system and get all of the drivers you need. Windows Update will do most of this for you if you let it, making it so that you only need to find and install your wireless or wired networking driver. Use "Computer Management", and copy the hardware ID of the device into the search box of the
Microsoft Update Catalog. It will generally return the driver (or list of drivers) that can be used for that particular device.
That's pretty much the basics. The rest is just practice and time.