How can I achieve Locomotion Animation changing based on terrain?

I’m still learning a lot, but having those key words and concepts already help me a lot to search more information on how to achieve layer anim and such. Appreciate it deeply!