Though it sounds absurd, rather than a tree, it might be better to put up a shade (i.e., two poles and a sail cloth between them) to block the lith/heat. It would definitely be cheaper than having a tree although your neighbors might not like it.
A tree must be trimmed annually once it reaches a certain size; eventually it must be removed. But then a new problem arises: the dying tree roots, which extend entirely across and below the land, and which had previously remained placidly underground and invisible, now begin to rot, swell and rise irregularly everywhere. They thrust upward at random ruining the lawn's former level appearance. You can no longer mow your lawn: the lawnmower strikes the rising roots and either breaks the blade or the lawnmower stalls. The surface is no longer level. You can let your lawn lie fallow for 20 more years until the roots rot completely or...
... you pay someone enough to remove all the roots and fill them in with soil, then re-level and re-sod the lawn. That likely triples the cost of removal.
Trees look great - from a distance.
It is a tribute to the old "pier and beam" construction techniques that their use evades these problems somewhat by allowing you to raise/lower the piers in response to tree growth/intrusion, thus maintaining a level house (so your grandkids can play marbles on the wood floor in the living room).
Root barriers may be a reasonable solution too, but they must be maintained. I am unfamiliar with their success rate.
I recently saw an 11-story high-rise whose foundation is endangered by the "nice trees" that were planted at its base to form a park for the building's inhabitants decades ago. The trees are moving everything: the building, the streets around the building, *everything!! Imagine having bought a condo in that buiding! What a disaster.