Every computer sold with Windows pre-installed must come with a tool for reinstalling the operating system. The most common approach puts the restoration tool on a special partition on the hard drive. Some PCs, especially from small manufacturers, come instead with an OEM Windows DVD.
But what do you do if the partition has been lost–either through a hard drive crash or user error? Or what if that DVD has been misplaced?
If you purchased the PC from a major vendor, contact them and ask if they can provide a replacement. These usually come on a DVD or a flash drive. I know for a fact that Lenovo, Dell, and HP offer this service for a small fee.
Another option that might work: See if you can borrow a Windows DVD from someone. It must be the exact version of Windows your PC had–for instance, Windows 7 Home Premium. It also must be a complete version, not an upgrade disc.
After the installation, when it comes time to activate Windows, use the activation number on your PC. It will be on a plate, probably on the back of your desktop PC or the bottom of your laptop. Do not use the activation number on the package the disc came in. If you do, it will either fail or severely inconvenience the friend who lent you the disc.