There are different versions. Here is one.
For want of a nail the shoe was lost.
For want of a shoe the horse was lost.
For want of a horse the rider was lost.
For want of a rider the battle was lost.
For want of a battle the kingdom was lost.
And all for the want of a nail.
When I was in grade school, I learned that this proverb referred to the death of Richard III of England at the battle of Bosworth Field. It was presented to us to teach the importance of paying attention to little details.