Good breeding, proper socialisation, effective training and being sensible with them where there are children - like with any dog (though, of course they are much larger than many dogs) They do tend to be fairly placid - or at least all the ones I've known have been.
Trouble now with every breed is that people get the dog because they like the look of it, or they've watched 101 Dalmations or Marley and Me and think that dogs are just like people in fur coats - they aren't.
There were fewer dog attacks in the past not only because there were fewer dogs but because most people chose a dog for a reason, and a lot of dogs had jobs - you want a guard dog, you get a GSD, treat it as a dog (not a baby) and train it properly; you want a herder, you get a border collie, train it and work it, you want a ratter - jack russell, as border or GSD etc
A lot of dogs become aggressive because they are so bored and under-exercised (and lonely) that they quite literally go mad.
Don't pick a breed because it's pretty, or you've seen it dancing at Crufts on the telly, or you want to be able to look like you are "controlling' huge dog. (Not unless you intend to fulfil its mental and emotional needs as well as feed your own fantasies.)