The good news is that built in laptop batteries can be replaced and that you don't need to buy a new laptop when the battery gets weak or fails.
The bad news is that it can be a fairly technical process to replace and should only be undertaken by someone with technical expetise or at least someone who is confident in dealing with a process which can be fairly detailed and involves handling very fragile small connectors and cables. All laptops are different so there is no single list of instructions on how this can be done. Youtube is a great source for videos and instructions to follow depending on the model number of your laptop. The difficulty is that the tiny connectors and ribbon cables are exceptionally fragile and cannot be replaced if inadvertently damaged.