it can be a challenge though. If the make and model of the AP you want to install was an option on the original equipment list of your aircraft and you can get the installation instructions, it can be installed without a STC. If not you Wll need an STC from the manufacturer. If you have an Stec AP, some have said they will sell you one for around $1000 but you have to send it back to them to be recertified and installed by one of their dealers. Other manufacturers will vary.
If your plane already had an autopilot installed but died. you can install a used AP of the same make and model to repair it.