The task is serialised into a queue broker (Redis, RabbitMQ, SQS, database). A separate worker process continuously reads tasks from the queue and executes them. If a task fails — it is automatically retried N times before moving to the dead letter queue.
Redis — the simplest option for small projects. RabbitMQ — an AMQP broker with flexible routing. Amazon SQS — a cloud solution with no infrastructure to manage. Apache Kafka — for high volume and event streaming.