An occasional spike in temps to that level was not a big deal. The houses were built to some degree for that environment and had , for example, narrow windows with some kind of architectural detail I've never seen elsewhere that helped shade the windows.
But after days and days of such temperatures, the AC blowing cold air felt like a joke. The walls were hot. The floor was hot. The couch was hot.
You learn to eat different and live different in an environment like that. You make sure you get enough to drink. You teach the kids to stay hydrated. You teach everyone the importance of electrolytes.
I went for walks for exercise after dark when the temp dropped to 99F. There was precious little shade and I sunburned easily which is another serious health threat on top of the risk of heat prostration.
Desert cities of old were built to keep things tolerable at street level. City location was chosen for ability to mitigate the heat, typically a plateau a little above the surrounding terrain. Streets were oriented to maximize the cooling effect of prevailing winds. Buildings were designed to reflect heat rather than soak it up, among other things.
Humans used to work out in the weather much more consistently than we do these days and tended to primarily get around on foot. Now, we go from home to car to office to car to store to car, etc. We don't have the same relationship to the weather and we seem to have forgotten how to live with weather.
At least in the US. Maybe other places are a bit better about such things.