Welcome!
Computer Hope is the number one location for free computer help.
The forum help everyone with all computer questions.
You do not need to format the hard drive.
Did you try nto boot with no CD present in the drive?
Did you try to boot from a floppy?
This forum area is for Windows before Windows 2000. So the question is why would you want to boot from the CD if the OS is windows 98? To install Windows 98 you always use a floppy to boot. If the system has to be repaired, do it from the floppy.
In any case, you had to go into the BIOS to change the boot order. Go back there and change it to the original settings.
Are you unable to get into BIOS because of the CD-Rom issue? I don't know of any older computers that do that, but maybe it happens.
Do you know how to open the case and disconnect the CD-ROM? If so, you can do that, power off of course, close the case and power up. It should ignore the CD-ROM because it is not there.
Now you should be able to get into BIOS or boot from a floppy or the hard drive. Later, when you get it sorted out, connect the CD-ROM again.
If none of this helps, , please tell what you did and what error messages, if any, you got.