If you are using drugs or alcohol to the detriment of your health, I could understand your father calling you an idiot. If you are wasting your life away and not making any effort to study and learn and develop new skills to help you make your way in the world, I’d see why he might call you an idiot as well.
But if you’re doing your best and just finding some things complicated, you’re certainly not an idiot. If that’s the case, your father is just lazy. He should be helping you instead of calling you names. His parents should have taught him to behave better than that.
Ignore his rudeness and don’t let him ruin your confidence. If you’re having trouble with schoolwork, ask a teacher or older student to explain things to you.