My oldest son is 14 now. I started when he was about 3 . I'd have an unloaded gun out on the bench working on it. Swapping triggers, detail stripping, that sort of thing. No ammo anywhere nearby naturally. He would curiously reach for it and I would correct him. He would stop. Curiosity would kick in again and I would correct him. After I was done working on it, I would reassemble, ensure it was clear and then offer him the opportunity to hold it properly under my supervision with it pointed in a safe direction. Rinse, repeat throughout the years.
When he was about 5 he had a friend over playing. My carry gun was on me, concealed. Everything else was in the safe. The safe was in our room at the back of a large closet. His friend went into our room and into our closet. My son came running to me to tell me "daddy, daddy, he's gonna get your guns." I went and picked the lad up and carried him back to the living room and explained that we don't go in people's closets. I gave my son a big hug and made a big deal out of him doing that.
He's 14 now. I'd trust him more with a gun than I would many adults I've met.
My youngest son is 6 and is on the same path.