The brain is really little more than a collection of electrical signals. If we can learn to catalogue those then, in theory, you could upload someone's mind into a computer, allowing them to live forever as a digital form of consciousness. But it's not just science fiction. Sure, scientists aren't anywhere near close to achieving such a feat with but there's few better examples than the time an international team of researchers managed to do just that with the roundworm Caenorhabditis elegans. C. elegans is a little nematodes that have been extensively studied by scientists - we know all their genes and their nervous system has been analysed many times.
In 2014, a collective called the OpenWorm project mapped all the connections between the worm's 302 neurons and managed to simulate them in software. The ultimate goal of the project was to completely replicate C. elegans as a virtual organism. But they managed to simulate its brain, and then they uploaded that into a simple Lego robot. This Lego robot has all the equivalent limited body parts that C. elegans has - a sonar sensor that acts as a nose, and motors that replace the worm's motor neurons on each side of its body. Amazingly, without any instruction being programmed into the robot, the C. elegans virtual brain controlled and moved the Lego robot.