The official language for labor, administrative and law-related related things in Morocco is French. However, the language that gives one the power to socialize, be more mobile and bend the rules is Moroccan Arabic (Darijah) and Tamazight. Spanish and versions of it are used in the North yet are simply either a form of habit or even mixed with Darijah.
There are plenty of French people in Morocco profiting from their forefather's colonial residual and many of them live in gated communities. They benefit from classist privilege that never disappeared after the colonial era. English speakers also thrive well in Morocco if they are diplomats or run businesses, such as import/export or educational ventures. English is either not accessible or valued by the average commoner and so, Anglophones tend to live in smaller pockets and bubbles throughout Morocco. Most end up learning French or had some knowledge of French prior to moving over. Learning general Arabic first and then local Arabic upon arrival is more realistic and practical for English speakers. Darijah is not a documented language but a hybrid of various languages. The best way to learn it would be through reading and writing general Arabic first. Moroccans will understand you and you'll be able to also read signage/documents (which are always equally in Arabic) while having the advantage of using it with other Arab speakers of different countries.
Communicating with the locals if you don't speak the native/official language fluently will require resilience, your hands lol, lots of money and time to waste. If you are a traveller already and have lived through Southeast Asia, Morocco will be a breeze. If you are an expat from Europe and don't speak French nor Arabic and are afraid of risky behavior, good luck!
In Morocco, these apps and tips are like gold:
-Linguee
-Google Maps (as things are often not properly positioned on the map!)
-Car park guardians (can connect you with apartment owners directly instead of apartment agencies)
-Eat where you see a high turnover of patrons or you will likely get sick.
-Like in the secular world, don't always believe people if they say they're Muslim. Let their behavior and actions be a testament to that!
-Take agreements with locals with a grain of salt. Be accountable to yourself even if someone makes you a promise!
-Prostitution is not talked about and many locals will try to reduce the epidemic here to that of other nations. I've never experienced such an uncontrolled yet coveted situation, anywhere in the world. Especially, online where intentions and identities can be hidden easier.
May the force be with you!