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.
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. Dell charges about $90; I don’t know what the others charge.
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.