Hello,
Personally I have installed Docker on WSL2 and I simply start bash (as in a linux distro)
(I used this tutorial to make the installation)
https://nickjanetakis.com/blog/install-docker-in-wsl-2-without-docker-desktop
If you use docker desktop (without WSL2)
From https://docs.docker.com/desktop/install/windows-install/
you should have an application Docker Desktop (but I have never used it so I have no idea)
For your question with
(and so on) you must create a file docker-compose.yml (in a directory) with the example you had
After that you do the command docker-compose up (if all is fine after the test you add -d to make a daemon)
Please pay attention there is only one file docker-compose per directory.
Personally I make a directory Compose and inside it one diurectory per container
(dsm, caddy, portainer...)
I hope it helped