Hardware support is required for preemptive scheduling.
Here, hardware support means generating periodic cycles that trigger an interrupt to the OS scheduler. The OS scheduler (or the dispatcher, same thing) checks whether enough time quanta has passed or not. If the time quanta of the current execution process is over, it triggers a context switch and brings another process from the $\texttt{READY QUEUE}$.
Without periodic interrupts from the hardware, there is no way of doing preemptive scheduling. An application can just keep executing without ever giving control back to the kernel.
In the case of non-preemptive scheduling, no interrupts are required as the application currently executes calls $\texttt{sched_yield()}$ when it is done with its operation.
The StackOverflow link people are posting talks about HOW the context switch is done, like who saves the context of the current process (register values, stack pointer, etc.). There are two ways of doing that: the hardware saves the context, or the OS does. Both are valid and can be selected based on what is required.