An operating system manages computer hardware and software resources and acts as an interface between users and applications. It performs basic tasks like memory management, process scheduling, input/output control, and file management. There are different types of operating systems including batch, time-sharing, distributed, network, and real-time operating systems. An operating system allocates resources, schedules processes, manages memory and devices, handles security and errors, and provides file management functionality.