While you can do so, it's not recommended. Heating, ventilation and air conditioning systems are more complicated than you might think. There are a lot of things that can go wrong during installation if you're not a professional. It's almost always best to contact an HVAC professional to handle the job.
Simply put, no, you cannot replace your air conditioning unit yourself. Even if you have the technical knowledge to install an air conditioning unit, all electrical components add a high level of risk to the process. In addition, advanced HVAC experience is needed to ensure that you get the right unit for the size of your home. Once the installation is finished, it is necessary to perform delicate tasks to ensure maximum energy efficiency of the alternating current, such as correctly balancing the ducts, adapting the new unit to the duct network and ensuring that it has the best intelligent thermostat to maximize the possible energy savings of the new unit.