For you to be able to format the previous OS and install another operating system, you need to have a flash drive that has operating system in it.
To install operating system on system using flash drive, follow these steps:
1. Enter into the system BIOS by pressing f2 or del etc. depending on the system, but you can easily know this by observing the screen of the system immediately after switching on the system
2. Select the boot option and select removable storage devices as the first booting device, save and exit
3. The system will automatically boot from the flash drive and install the operating system. To complete the installation, follow all necessary prompt or guide during the installation.
Note: make sure you remove the flash drive after the operating system installation and the system prompt for a reboot (if the flash drive is not remove the system will restart the installation process again)