Drivers are software components that let an operating system and hardware device communicate. They’re typically designed by the device’s manufacturer (not always!). Applications will call OS functions/syscalls that then call a function implemented by the driver. The driver knows how to communicate with the hardware. Then it’ll return back to the user.
Drivers are typically implemented in a driver stack, where an application-level request can go through multiple separate drivers. A function driver communicates directly with the device. Filter drivers do intermediate processing.
Drivers can also be split into where they operate in the OS. User-mode drivers (UMD) operate closer to the application. Kernel-mode drivers (KMD) operate in the OS kernel mode and can access core/protected OS data. On Windows and Linux, most drivers run in kernel space. On macOS, drivers run in user space.