This question is more directed to those who deal with very low level hardware details (say kernel programmers) than those who deal with high level issues often referred to as software developers. I will answer since I assume this is still Computer Science!
You will not want to run a user application and it suddenly erases everything on the screen, erases ALL data in your hard-drive, refuses any access to any hardware, take full control of CPU resources, and so on and in very unpleasant ways. The kernel is the master who controls user accesses to system utilities. Also if one user application fails then it will be 'alone' to die in peace! So viruses often target the kernel so to make meaningful damage.
Such protection cannot be efficiently done through software. That will require the Operating System to check every instruction of the user application, making sure there is none with evil intent! An example is one which tries to directly write into kernel memory space. For example trying to access memory at address 0 will generate an interrupt called General Protection Fault. Go to the link below and search for the text "Privileged Level Instructions".
Kernel mode is implemented by configuring system registers like the GDTR (Global Descriptor Table Register). Go to the link below and search for the title "Global Descriptor Table". Based on the configuration of this register the General Protection Fault interrupt is generated when privilege level is violated.