Inspiration often comes from people who have faced life's biggest challenges. It doesn't matter if the person succeeded or failed. In the end, it is the effort and struggle that is highlighted.
Famous inspiration quotes come from people who are credible of doing so. I believe it is because, their mind, upon all those hard hitting events faced, subconsciously constructs reasoning or causes, solutions, maybes, and ifs, plays around with it using the conscious mind and then gives birth to one of the best quotes that can be used by anyone to be applied in their lives.
There's no real formula to it I guess, apart from going through the thick and think, or even listening to somebody else's struggle.
Here's some quotes I find very usable:
“So, verily, with every difficulty, there is relief" - mentioned twice, in the holy Quran
"An Idle mind, is a devil's playground" - Anonymous
"Nothing comes from doing nothing" - Anonymous