It depends on what kind you have but in general:
There are little motors that clamp onto the cables or lever that operates the ailerons and possibly the elevator or elevator trim if it has altitude hold and maybe the rudders if it has rudder control.
It can be set to follow the HSI, DG, VOR head or GPS head for its right and left. It can be set to follow the glideslope on a VOR/GS head. Some also have knobs that you can turn to a heading or just turn the knob to turn the plane. There are altitude hold and altitude select options. There is one simple kind that just attempts to keep the wings level (and sort of fly straight ahead).