You first have to do 6-12 months in a state-approved trade school (costs $15-20K on average in CA).
Then comes 4 years of apprenticeship. But good luck finding a licensed journeyman who is hiring or actually gives a shit. And if you're lucky, you will spend the entire time doing bitch work and get paid a whopping $12/hr. It also comes with requirements like bringing your own truck to the job. Want to join a union? Rejection rates for early career apprentices is >95%.
If you somehow make it through this you finally get a license and the honor of fixing people's light bulbs. Do this for a decade or two and gain experience and you'll be making like $80K/yr (https://faradaycareers.com/careers/electrician-salary).
No shit smart people are studying coding instead.