An operating system (OS) is the essential software that manages hardware and software resources on a computer or mobile device, providing a foundation for applications to run and users to interact with.