B wrote good advice. Margie said she couldn't really add to it, but then she did add some brilliant statements. Anne, as always, wrote supportive and knowledgeable things. Michelle gave great advice to wallow in it for 10 minutes, and spend the rest of the time (23 hours, 50 minutes) being a better mother, the kind you aspire to be. We all did better when we knew better - meaning we all made mistakes and learned from them.
I'll add that a lot of what you worry about is from the first 2 years of your child's life. For some reason, at age 4, you decided to let him eat muffins and donuts for 2 years. So look at what you did and why. Are you trying to be his friend? Or his mother? Being a parent means making the hard decisions even when kids fuss and cry and have tantrums. You learn to manage them, to ignore them, to do the right thing whether a 4 or 6 year old understands that. Your child's health and nutrition going forward are all you can control - so his learning and focus in school, his stamina, his ability to fight infections, his dental health, and his behavior are all going to based on what you do tomorrow and the next day. Being consumed by guilt for what you think you did wrong when he was a baby will just paralyze you.
Please see a counselor about your guilt and your need for our validation, get in a moms' group to learn how other parents manage kids' eating and tantrums, take a parent/child cooking class to learn how to make nutritious meals that are fun and delicious, and get into the children's library to choose some fun books to read with your child that show kids and families having healthy and fun lives.