The answer to this question is pretty straight forward, it happened to me this morning. When I finished working on my project I closed the docker app for Mac (mainly what the error says is that it cannot get the API version of Docker and or docker-compose).
Make sure your Docker for desktop is running everything else should be back to normal.Check this image to see if docker desktop is running.