I'll give you an overview of the basic web application architecture that is involved with setting up a headless WordPress site.
A WordPress application is made of three key components:
It used to be an arduous task to get set up locally to run a WordPress instance. You needed to correctly download and configure a web-server and a database. You then needed to get the files installed in the correct place for the web-server to be able to access them. This was particularly grueling on a Windows system.
The WordPress hosting company, FlyWheel, has a tool called Local which I use exclusively for all my WordPress development. With a few clicks a web-server is configured, the files downloaded and the database prepared for you.