Blink light and stop by sending command to Serial

having loop() sequentially invoke multiple sub-functions would be more accurate. in this case, one sub-function monitors the serial interface while a 2nd sub-function flashes an LED

the term "task" is misleading because there is no operating systems doing context switching between tasks that independent of one another such as on an esp32. operating systems also include mechanisms for tasks to communicate with one another

of course, windows and linux are multi-tasking operating systems