There are several numbers you can call for general emergencies, including Vodacom mobile networks. Metrorail has its own security/emergency number. If you get lost on Table Mountain, call Metro Medical Emergency Services, and for all sea emergencies, call the National Sea Rescue Institute (NSRI).
Emergency services at public hospitals are overworked, understaffed, and underfunded. Visitors are advised to use private hospitals, which are open 24/7 and have ambulances linked to their private hospital group (although these services can transport patients to any health facility). Most public hospitals have facilities for private patients at lower rates than the fully private hospitals. Make sure you have medical insurance that's good in South Africa before you leave home.