The explanation I’ve been given is that IF you let the hammer slip and the gun discharges, not only has your gun gone off unexpectedly, but your thumb is now occupying the same space that the metal slide of the gun will be filling momentarily.
Remember: You are made of squishy bleedy bits, while your gun is made of solid and often sharp metal bits, and that slide is moving FAST. I’ve never had it happen, but the instructor at the shooting range last week had seen it on the range before, and he told me that it looked pretty painful.
As far as how you carry it, as others have said, it depends on the gun. Aside from different trigger mechanisms, some weapons have various built-in safeties (the Beretta 92, for instance, has a piece that rotates when you squeeze the trigger. Don’t squeeze the trigger, and this piece will block the hammer from hitting the firing pin. Note that you cannot manually decock a Beretta 92 without squeezing the trigger, and we come back to the top paragraph.
But yeah, with the Beretta, we were told to carry it loaded, chambered, hammer down, safety off, unless ordered otherwise. Don’t put your finger on the trigger until it’s pointed towards the bad guy (or paper targets or whatever), and it shouldn’t go off that way.