Once upon a time, there was a lazy farmer who lived in a village. He owned a few pieces of land but didn't take good care of them. He didn't plant seeds on time, which resulted in poor crops. This made him always have a shortage of food. The farmer also had a small garden near his house, but the fence around it was broken. He thought to himself, "I'll fix the fence tomorrow." However, he forgot about it the next day and several days passed without him fixing it.
One day, while the farmer was sitting around in front of his house, he noticed that some goats had gotten into his garden through the broken fence. He called his wife to come out and shoo the goats away. But his wife was busy cooking inside the kitchen. When she finally came out to chase the goats, a dog that had been waiting outside the kitchen took the chance to sneak in. It ended up ruining some of the food the wife had prepared.
So, the saying "A stitch in time saves nine" means that taking care of small problems early can prevent bigger problems later on. In this story, if the farmer had fixed the broken fence right away, he wouldn't have had the goats in his garden, and that would have prevented the dog from getting into the kitchen and spoiling the food.