No hay mal que por bien no venga.
“There is no evil from which some good does not come.”
Even bad situations often bring an unexpected benefit or lesson.
— Traditional Mexico Wisdom, Mexico
Source: Traditional Spanish-language refrán widely used in Mexico, public-domain oral tradition