Error: couldn’t connect to server

I was having same issues recently but before I had this issues it used to connect without me opening any terminal to start mongodb up.

What is your os?
How did you install your mongodb
Is it configured to start as service or manually
If you are able to connect without starting mongod means it is installed as service
It comes up automatic even after reboot
All you have to do is connect by issuing mongo which connects you to default mongod running on port 27017

If this is specific to M001 course please use IDE as Steeve suggested