The Occupational Safety and Health Administration (OSHA) is a federal agency which defines and enforces safety protocols for industry. You will learn about the relevant safety procedures during your training and on-the-job training. For instance, you will be taught about the OSHA "Lock-out-Tag-out" procedure. This rule requires you to lock the circuit breaker (off) along with your ID tag before starting work. While the lock is in place, no one else can energize the circuit - it is your lock and no one else will have the key. There are many more procedures like this that are meant to protect you and many of them overlap so that a single mistake will still not cause you harm. Safety procedures are also created and enforced by each company (more redundancy). You will be safe if you are careful, listen to your training, and always follow the safety procedures before and during your work on energized circuits.
I have been shocked multiple times and each time it was because I was rushing to do something and didn't follow my own or company safety rules. So just learn and follow the rules, and you will never be shocked.