When I format, I have a floppy disk. Make sure when you format you have the system disk though or else, it wont have a OS and it wont start It should be a win 98 disk so it will turn to 98. Then turn it to 2000, then XP.
Trun you computer on with you OS disk in and it will give you a menu. It's nothing hard... back up anything you want to keep and don't mess with the settings if you don't know what they're for and you should be fine.
Dells and Sonys have programs to reimage it back to the way you got it. If it is prebuilt you should have system recovery disks, use those.
I always loved Delpart.com (not a website).... a little itty bitty program that deletes all of your partitions in 1 second.... then i use the XP disk.