Python and the ArcPy python package is automatically installed when you install ArcGIS Desktop or ArcGIS Pro on your computer. While this does make it convenient to write scripts that automate ArcGIS software processes, there are important things to consider before you can really get started effectively using the ArcPy package. First, it is important to note that ArcGIS Desktop (which includes ArcMap) is packaged with Python 2.7 and ArcGIS Pro is packaged with Python 3.6. This means that if you have both ArcMap and ArcGIS Pro installed on your computer - you have two different versions of Python installed on your machine (and maybe even more than two if you have separately installed Python). This is important because you have to make sure any script you write is processed by the correct Python installation and it also means that a script must be written with the specific version of Python you are trying to target in mind due to differences between Python 2 and Python 3.
Visit the sites below for in-depth information about using ArcPy to automate ArcGIS Desktop and ArcGIS Pro processes:
If you are looking for general Python documentation and tutorials to help build up your Python skills in preparation for GIS related scripting you may want to visit the following websites which offer useful resources to Python learners.