GA (General aviation, people who own a little plane and maybe just fly it for fun, or it's a professional expense for say a plastic surgeon and allows them to fly 300 miles home on Thursday evening after working four days in the big city) is not safe. A few hundred of these people die, not just smash up their planes or get hurt, but die, sometimes with family or friends aboard, every year. It might make the local TV news, at most. Unless they were a celebrity it won't make national news.
Commercial is more complicated because there are so many possibilities. Cargo is pretty safe, if your job is to move boxes of stuff from one big jet airport to another in a civilized country you'll likely die in bed of old age. But if you fly a police helicopter, or medevac, or you're a crop duster, or you fly custom pick up jobs, when the client wants and where they want - those jobs can go badly wrong much too easily, without you really understanding what you've got yourself into until it's too late. These people are (or at least should be) better trained than in GA, but they're also often flying more demanding missions. You may operate out of somewhere with not-so-great capabilities, on short notice, in poor weather and/or at night, and you may be expected to go places that you ordinarily wouldn't, close to buildings, close to other aircraft, even close to the ground - all of which narrows your options if things go wrong.
Military is also pretty bad as I understand it. It needn't be, but there's some sense that the job is "supposed" to be dangerous, which maybe makes sense for front line infantry, but really not for the vast majority of military pilots - way too many of them die far from any enemy, as a result of somebody screwing up, just like in GA or commercial.
I can think of one (1) single fatal crash that wasn't due to overconfidence, ATC error, bad piloting, poor maintenance, etc. It was a horrific helicopter crash I'll never forget; we drove by on the way back from school and it was still on fire. Surreal sight.
[0] https://www.nbcmiami.com/news/local/dean-international-fligh...
https://www.sec.gov/Archives/edgar/data/791683/0000791683030...
On a per-hour basis, GA is probably more dangerous, given the greater passenger-miles per hour.