There are basically 2 modes in which a modern OS works.
User mode and kernel mode.
Whenever the the system boots ,OS transfers control to kernel mode , where kernel runs all the necessary routines and then kernel switches to user mode.
User mode allows users to run any programs of their choice .
However if there are any instructions that could alter some parts of OS or any of your resources ,IO systems ,they are marked “PRIVILEGED”
These instructions are allowed to be run only in kernel mode
Kernel then executes such instructions and returns control to User (Depends on the type of the privilege instruction)