The quickest way from Marrakech to Essaouira is a direct Supratours or CTM bus that covers the 240 km in roughly 3 hours for 80–110 MAD (indicative). There is no train and no domestic flight — the only realistic options are the two bus companies, a shared grand taxi from Bab Doukkala, or a private car. Each works well; the right choice depends on how much flexibility and comfort you want.
Essaouira sits on a headland battered by the Atlantic trade winds, and the road there runs west through low argan scrubland punctuated by the occasional Berber settlement. If you have never seen goats balanced in argan trees — and this part of Morocco is where that actually happens — the drive itself is quietly entertaining. The N8 is paved the whole way and in good condition, so the ride is comfortable whatever mode you choose.
For a day trip from Marrakech, leaving by 7–8 am gives you 4–5 hours in Essaouira before the return. That is enough time to walk the ramparts, wander the blue-and-white medina, eat grilled fish on the port, and browse the wood workshops that line the souks. If you want to stay overnight — which is genuinely worth it — the logistics simplify considerably.