It sounds like you're trying to replace the internal hard drive of the PS3. If so, the PS3 will detect that and prompt you to format it on start up. You shouldn't need to download/run anything from a USB flash stick or CD/DVD at all. It is very much 'Plug and Play' in that regard.
Once formatted, it will install the version of the OS that the PS3 was released with. Once up and running, you can update from this version as you would normally: by connecting it to the Internet and checking for updates using the 'Settings' menu and allowing it to download the updates.
These updates can also be done using a USB flash stick, which I believe is where you're getting confused. As @Memor-X states - you can update using some Game's disks - if you get some new released games it'll stop you from playing until you updated the system to the required version, which is included on the disk.
But you shouldn't need either a USB stick or a DVD if all you're doing is replacing a faulted/corrupted hard drive.
If you're still unsure, there are plenty of guides that walk you through how to replace a PS3 hard drive on Youtube, such as the one below. Basically, the process is:
- From the PS3, Back up your saves to a USB flash stick or external hard drive
- Disconnect the PS3 from the power.
- Locate and take off the hard drive cover.
- Remove the 'blue screw', which holds the hard drive bay in place.
- Remove the hard drive bay, and unscrew the old hard drive.
- Swap out the old drive for the new one, and rescrew the hard drive in place.
- Replace the hard drive bay (making sure to push it in firmly).
- Replace the blue screw and hard drive bay cover.
- Reconnect power, turn on your PS3 and follow the prompts to format the drive.
(Note that your controller may need to be plugged into the PS3 by the charging cable in order to function correctly.)
- Restore any backed up saves/data.
Note: Every PS3 hard drive is encoded to that specific PS3. Once replaced with a new drive, the encoding is changed. This means that - should you be able to get save files off the corrupted drive, you should do this before replacing the drive.