First, you will need to keep the brain in an apparatus that keep it constantly well-nourished, oxygenated and also removes wastes from the outside environment. Most people die when this fails, since a failure, a trauma or a disease in the lungs, heart, kidneys, liver, intestines, infections, etc. can lead to improper nourishment and oxygenation in the brain or to the build-up of dangerous levels of toxic substances inside it.
Also, the apparatus should keep the brain well-protected from the outside environment, preventing head injuries, head traumas, gunshots, concussions, infections and entrance of toxins.
There is still the problem from diseases in the brain itself, like cancer, dementia, alzheimer and stroke. Cancers and strokes could be prevented if the brain is constantly scanned by the apparatus and is able to perform precise micro-brain surgeries when something wrong is detected.
About dementia and alzheimer, possibly a steam-cell therapy could be used to replace lost areas of the brain with new neurons and glial cells.
A bad side-effect could be that as the old brain has its life prolonged indefinitely and parts of it are continuously being replaced, when it reaches the age of, let's say, 600, it is likely that > 99.9% already have been replaced and the person would probably not remember anything from before the implantation, it will say:
"After so many centuries, I can't recall how my father or my mother were other than through photos or videos, I don't remember my infancy, nor my teen years, nor when my children born, it was a so long time ago that it was simply lost to the time. I simply can't remember anything anymore from before my brain was inserted into this apparatus centuries ago and even for some time after that. The best that I can do now is to ask the computer to give me those very old information. However, in the past, I could recall all those things, even for many years after being inserted here. Well, this is the price to pay, otherwise, I wouldn't live those centuries and I would be dead instead. And I surely lived good centuries and still want to live some more centuries for sure".
Further, in this apparatus, since the brain is not limited anymore by the size of the skull nor by its energetic needs, you could make it grow larger and possible much more intelligent by strategically implanting steam-cells or even mature neurons and glial cells. But, nobody knows yet for sure how to do this right. Do it wrongly and those cells will either do no useful job at all or they will harm the brain's mind by making confusion, insanity, aches, epilepsy or who-knows-what-else.