Thank you for your question. It is very important to distinguish between children and adolescents. It depends on what the past misdeed or negative experience is.
Young children idolise their parents and they need boundaries between themselves and their parents to feel secure. Telling a young child about your indiscretions would be crossing this boundary, and could be very traumatic for them, because they view themselves as part of the parent. Young children have not yet formed their own identity, and telling them about misdeeds could shatter everything they've always believed about themselves, leaving them feeling confused, and impacting negatively on their self esteem.
However, relating personal negative experiences about lying, cheating, and bullying could be of benefit to the child. Children love to hear stories about your childhood. Knowing that you had similar experiences to them can help them to feel understood and supported. However, when telling the story focus on the positive things you did, and the lessons you learnt from the experience, rather than giving them details about what happened. Discuss the steps you took to fix the problem, if necessary. Teaching your child to think critically is more effective than telling them negative stories about your past. They should be able to question how their behaviour will affect them, and how their actions impacts on others.