One of the prime objectives of an operating system is provides a standard interface for the user's processes to use the non-standard functionality served by the varied hardware of different machines.
Normally when the computer is switched on and the CPU first receives power it will read a specific memory location (fixed by the manufacturer) to get the address where the first instruction of the first program it must execute is stored. Both the memory location and the first program are stored in ROM (Read Only Memory). This program is normally called the BIOS (Basic Input Output System) and it starts the program to deal with input key presses on the keyboard and basic output to the display.
It then reads the hard disc boot sector to copy into RAM (or load) and execute another program responsible for loading and executing the Operating System which is usually on the hard disc, be that Linux, MacOS or Windows. The Operating system consists of a number of processes and programs which not only provide the user interface we see but much else besides.