A hard drive's capacity is divided into sectors. Most hard drives also have a reserve of sectors that don't normally get used, so if some go bad, some from the reserve can be used. If this happens, the bad sector won't be used again. Your drive's diagnostic system has reported detecting bad sectors, some have been reallocated already, some are still pending. This process can happen - as far as the user is concerned - pretty much silently (ie. without interruption / excessive delay).
If a sector goes bad, there isn't any way I'm aware of to fix it. It's an issue that qualifies for warranty repair (if the drive is still in warranty) and the drive will be replaced by the manufacturer (ie. I have not heard of a manufacturer repairing bad sectors).
IMO a drive developing bad sectors is often a sign of the drive's deteriorating health. I advise customers that if their need for their computer is urgent enough that the faulty drive causing problems (such as Windows not starting) would be a serious inconvenience, and that the customer would prefer to avoid such a scenario happening unexpectedly, then I recommend replacing the drive ASAP. If however the customer would not be seriously inconvenienced by the drive dying unexpectedly and the subsequent time to replace it, then I recommend letting the problem run its course for now.
Hard drives can die in two ways:
1 - sudden death ("It was fine the night before, now it refuses to work at all")
2 - death by a thousand cuts ("the computer has been running very slow lately, sometimes Windows wouldn't start the first/second/third time, and the problem is getting worse")