I learned mental toughness from physically grueling experiences (wrestling, digging holes, mixing cement). Experiences where I put myself in a mindset where I didn't have a choice but to persevere. After doing that for years, dealing with most mental/emotional struggles are manageable.
http://classics.mit.edu/Epictetus/epicench.html
My own opinion is that a lot of mental toughness can be developed simply by realizing what you can control and what you can't. This is known in stoic philosophy as the "dichotomy of control", and is put this way in the Enchiridion:
“Some things are within our power, while others are not. Within our power are opinion, motivation, desire, aversion, and, in a word, whatever is of our own doing; not within our power are our body, our property, reputation, office, and, in a word, whatever is not of our own doing.”
By far my favorite example of any individual human's mental (and often physical) toughness. There's a thousand examples where he displayed herculean mental strength in the face over overwhelming situations.
Some that come to mind:
1. He took groups of cavalry out on attacks during a heavy winter, letting each group of soldiers take a turn resting, while he went out on every mission.
2. He grabbed a shield an went to the front of the lines when the Nervii were about to slaughter his entire force. Turning the tide in a situation almost no one else could have survived.
3. Instead of giving up the siege of Alesia when a massive relieving army was inbound, he went double or nothing by enclosing himself in a double wall investment.
4. He attacked a beach full of unknown numbers of enemy soldiers with chariots, in D-day style amphibious assault.
He did a hundred major things like this in his life, and a thousand minor ones we know about.
An excellent audiobook version is available free https://archive.org/details/Commentaries_Gaius_Julius_Caesar
My personal favourite is called /Winning Through Intimidation/ , I think it is much more relevant to our capitalistic and legalistic society than military memoirs or the ancients, as much as I enjoy them. https://www.amazon.com/Winning-through-Intimidation-Victor-B... . It is not prescriptive because it is a bit dated and specific to real estate, but the core ideas are rock solid.
Striving directly for toughness can lead to you feeling bad or angry at yourself for having certain feelings, when actually feelings need to be felt, not repressed.
It's shifting your inner monologue from:
"You shouldn't feel so sad about that girl dumping you. You were only together for a few weeks. Stop moping around." to "You're feeling really sad right now, and that's totally expected and ok. It's probably going to last a while longer, and that sucks, but you're going to be fine."
This might be obvious / intuitive for most people, but as someone who always used to default to the first version when "talking" to myself, it's been a big shift.
To actually answer the question, the book that introduced this idea to me was "The Art of Extraordinary Confidence" by Dr. Aziz Gazipura.
Really any text that explores Stoicism by it’s very nature also explores the different aspects of your mind that people traditionally refer to as “mental toughness”