If you're serious about learning how system safety/security works, especially in software, here's some resources you can study: