If all ACM failed, an alarm would sound in the cockpit. And two messages would appear on the ECAM/EICAS¹. One indicating that the ACMs failed and the other indicating that cabin altitude² is rising above desired level.
Pilots would execute corresponding checklist, and the one for rising cabin altitude calls for rapid descent to 10,000 ft. That is the altitude where humans can breathe safely.
If the problem is a hole in the fuselage, the oxygen masks would drop to allow breathing until the aircraft descends, and emergency descent (with full spoilers) would be done. But if it is just failed pressurization, the outflow valve would close and the pressure would only decrease slowly, so the aircraft would most likely descend before the masks would be needed and they would not release. Even normal rate of descent is usually sufficient in such case.
If you're flying above mountains, there are additional rules where to fly to avoid any terrain rising above 10,000 ft, which will be part of the flight plan. For example flying along the mountains of Peru, you'd need to deviate toward the ocean during such descent.
Now at lower altitude, the aircraft flies slower while burning more fuel, so it probably won't be able to make it to the original destination any more. However when planning flight and calculating the required fuel this is taken into account, so the aircraft has enough fuel that it can make it to one of suitably selected diversion airfields if it needs to descend to 10,000 ft at any point along the route.
¹ Modern aircraft have a display on which information about any problems and abnormal conditions is printed, which is called ECAM by Airbus and EICAS by Boeing. Older aircraft had large panels of warning lights.
² Pressure in the cabin is usually given as altitude at which that pressure occurs in standard atmosphere. Normal cabin altitude is 7,000–8,000 ft, 10,000 ft is maximum safe altitude (with generous safety margin). The oxygen masks fall out if the cabin altitude exceeds 14,000 ft.