The insanity defense is when someone accused of a crime argues that they were not able to understand what they were doing was wrong and are not responsible for their actions because of mental illness or disorder. It's like when you're sick and your mom knows you didn't mean to break her vase because you didn't know better.
Let’s say you have a toy, and someone takes it from you. You get really mad and decide to hit them. Normally, you would know that hitting someone is wrong and could get you in trouble. But let's say you have a "boo-boo" in your head, like an illness or disease, that makes it hard for you to understand right from wrong. You hit the person and get in trouble. But if you have a "boo-boo," like mental illness, you might be able to use the insanity defense and say you didn't know what you were doing was wrong.
It's important to remember that just because someone uses the insanity defense doesn't mean they didn't commit the crime, it just means they may not have been able to understand it was wrong. Imagine if someone took your toy and you hit them, but you didn't understand it was wrong. You still hit them, it was still a bad thing to do, but you didn't understand why. The same can be true for grown-ups who have a lot of big feelings that they don't know how to handle.
Finally, not every person who uses the insanity defense will be found not guilty. Sometimes a judge or jury will decide that they still knew what they were doing was wrong, even with their "boo-boos." It's like when your mom knows you didn't mean to break her vase, but it was still your responsibility to behave properly.