Marrakech is a city in Morocco.
North towards Casablanca, Rabat
From the train station, walk north along the road following the signs for Casablanca in order to hitchhike. The city goes on for a long ways, but there is a wide spot in the road next to a petrol station where it is possible to thumb a ride to a wide spot in the road at the edge of the city.
West towards Essaouira
From next to the train station, take a bus L22 along the street Av. Hassan II (it costs around 60MDH). Get off when you see a big supermarket and a Afriqua petrol station on the right. It takes about 10 minutes and you're a bit outside the town then. There is a number of roundabouts and parking space, so the cars are passing slow. You can supply yourself in the nearby large supermarket. And the direction is clear, many cars will go to Essaouira.
South towards Ouarzazate through Tizi'n'Test
You can walk two kilometres to the road from Bab Debbagh or can take grand taxi or minibus (6dh) to the nearest village Ait Ourir, make sure you exit the car before it turns away from the N9 to Ouarzazate. They also have stop near Bab Debbagh. Don't start to late, the trip to Ouarzazate will take you some hours and you don't want to miss the beautiful view in high atlas.
South towards Imlil, Atlas Mountains
Walk to Charij Bgar bus stop continue walking pass the circle roundbout get on the road R203 and hitchike to Asni or Imlil