Before starting your retaining wall project, please be aware that if your retaining wall is above the height permitted for D.I.Y. construction in your area, you'll likely need council approval and engineering plans.
An engineer can design a retaining wall that's appropriate for your site, including the footing and drainage requirements, and specify suitable materials for the job.
This is because a number of factors need to be considered, including soil type, hydrostatic pressure, drainage, any loads above the wall, and the potential impact on neighbouring properties. - JacobZ
Take the time to mark everything out before you start digging. Running string lines for both the height of the wall and the alignment of the posts made it much easier to keep everything straight and level.
I also found it was worth dry-fitting the posts and sleepers first to confirm the spacing before digging all the holes. A little extra time spent on preparation made the rest of the build go much more smoothly. - RenoMike
No matter what material you use, the upright posts will need to be concreted into the ground. This stops the wall from tipping. I prefer to always have three support points for sleepers in retaining walls, one at each end and one in the middle, as long boards can be inclined to bow outwards.
Treated Pine is far and away the most economical and easiest material to work with. If you're planning to grow food, I'd recommend using a non-CCA treated product.
Here’s my step-by-step guide How to build a retaining wall that contains a full list of tools and materials and video tutorial. - Adam_W
If you're retaining soil, you need to build a retaining wall that is self-supported with its own posts. A retaining wall should always be designed to support the full weight of the soil it is retaining.
If the wall is being built along a fence line, a separate retaining wall with appropriately sized posts should be installed on the fence side to carry that load. Fence plinth boards are not designed to act as retaining walls, and relying on them to retain soil can, over time, compromise the fence's structural integrity and lead to premature failure.
It's also important to install drainage immediately behind the retaining wall so it captures water transferring through the soil. Line the trench with geotextile fabric, install slotted agline and backfill with drainage gravel.
The trench should be as deep as practical, but there's no need to go deeper than the clay layer. A deeper trench collects the water saturating the soil, leaving room for surface water to seep in and be carried away.
When transferring that water to stormwater, use solid PVC pipe or non-slotted agline. For connection to stormwater, a licensed plumber will be required. - MitchellMc