We've known how to heat a dwelling for thousands of years. You build a fire, plus trap inside the heat generated by humans and animals dwelling in the building. In some settings you let sun shine in a south or west facing window. All of this is relatively low tech and enables humans to live in cold places.
Knowing how to cool a building in a hot climate is harder. There are a few low tech ways that somewhat work, and have been used for a long time.
The modern addition of air conditioning began in earnest about a century ago, mostly in movie theaters. Since World War II it has fostered the movement of population south to places like Arizona and Florida.
What got me thinking about AC was a comment by RealClearPolitics' Sean Trend who writes in the context of population shifts:
Probably the best we can say is that these numbers suggest continued migration from North to South, which is in many ways the story of American demographics for the past 80 years.
Air conditioning has made summertime life in warm climates bearable while their winters always were pleasant. People complain about global warming, but we know how to deal with that, you chill your homes, offices, and autos using AC.