An operating system or simply O.S is responsible for managing software and hardware resources.
In hardware OS is responsible for managing RAM ( Random access memory), ROM ( Read only memory) CPU usage and other connected peripherals.
In software OS is responsible to allocate these resources to different processes and background services that are working on a PC