How to run async tasks in ASP.NET Core?

How to run async tasks in ASP.NET Core? How to run asynchronous tasks when the application starts in ASP.NET Core? Sometimes, you need to perform a one-time initialization logic before the application can start normally.