How do you program a 3D printer?
The foundation of any 3D printer is the controller and the firmware. Many devices are based on Arduino type controllers, with stepper motor driver boards either integrated or added as a plug-in component.

Some manufacturers will use in-house or outside resources and develop their own boards and firmware.

You can search for 3D printer controllers and get a pretty comprehensive list of the various devices available for purchase.  Smoothieboard is one device, Raspberry Pi and Arduino as noted above, and others.

There can be found varying "flavors" of firmware to load onto these controllers as well.

The field is exhaustive.

To address your focus regarding the printing aspect, that's one stepper motor per print head/nozzle (usually) and involves calibrating the amount of filament dispensed from the nozzle per unit steps, or more easily understood, amount of steps per unit of filament movement. My stepper motor for the extruder has a planetary gear and moves 100 mm of filament for about 5000 steps.

All of the parameters you've noted are integrated with the firmware. Motor calibration requires movement per step or steps per millimeter to be entered, unless you purchase a turnkey system with the values loaded.

You can adjust many of the parameters from the slicing software, but it's more practical to determine the calibration settings, enter that information into your slicer and proceed with model management.

Look into instructables for others' build projects to see what they've accomplished and the steps involved in such a build. This can give you a starting point for your efforts.