How do they fix dams when they break?
Well! *borrows Uncle's engineer hat*.
When most dams are being built in the first place, the river or body of water they're planning on blocking with said dam is diverted so that they've got a dry area to build in. If there are ever any cracks or breaks in a dam then the diversion can be re-activated. For example the Hoover Dam took so long to build not just because it's so big, but because there are massive tunnels and pipes under the surrounding hills that were used to divert the water while the dam was being built. If there is ever a crack or breakage large enough then the water can be diverted through those alternate tunnels until the dam is dry again and then repairs or rebuilding can take place.
Another option is that during a drought (like happened here in Australia in the late 90's - early 2000's) some dams can actually dry up because the rivers aren't running as much as they used to - and so the maintenance can be done then. About 100kms from where I live there were seven new dams built during the drought, taking advantage of the dry spell so that next time we'll have more water stored up and the droughts' impact won't be so large.