Robotic parts connected to the body--how?

Hi; I’m curious how robotic parts are connected to the human body. I imagine it would be tough to connect a human nervous system, controlled by the mind, into lifeless electronics! Not to mention the infection risks at the connection points…

Some basic background:

Basically, decades of animal testing have allowed scientists to identify neurological patterns in the brain that roughly correspond to certain body part movements. They can monitor that and make artificial limbs that try to move the right way. Or sometimes systems like exoskeletons can be controlled by whatever motions you’re still capable of making, whether that’s partially lifting a limb, or perhaps trying to move what’s left of a(nother) limb. Here’s video of a robotic exoskeletal walker that’s controlled by a wrist remote.

As for infection risks, well, I imagine it’d be no different from any other sort of invasive implant using biocompatible materials.