When a structure is built into a hill, there needs to be a retaining wall. This prevents the hill that was cut into from moving down into the structure, causing damage.
An engineer is needed for this. Old barns (horse and dairy) in the northeast where I come from often cut the hill away and made a rock wall as the retaining wall. This wall would then become the foundation for the barn and the back wall of the stalls.
There is no related material for this topic.