It sounds like you enabled a BIOS password. Probably you need to open it up and remove the small CMOS battery on the motherboard. It will however clear all settings such as hard disk dimensions, BIOS settings and so on, so you would need to set all those again.
That is assuming you have a somewhat obsolete computer, about 10 years old. I'm not sure if the most recent PCs still have such batteries or more effective ways to bypass an accidental password.