A burnt child dreads the fire.

Meaning: The person who has burnt himself or has got into trouble is very careful to see that it doesn’t happen again. Any such painful experience is not soon forgotten.