1. by using timer like every task of generally similar priority shares similar time for system resources, for eg. if there r 3 tasks running in system of same priority, the timer will expire every 200ms and kernel will store current state of task in TCB and take out the next tas from TCB (Task Control Block).
2. when one task cmpletes its objective, system finds another task if waiting for system resources of higher priority and gives it control waits fr it to finish its operation then switches to another task.
3. priority based task switching where high priority task preempmts low priority task for system resources and then low priority gives control to high priority task when it complets its operation kernel checks if another high priority task is waiting, and if not it resumes low priority task.
there are other methods as well based on type of kernel, google for it.