Joint analysis of the thermal Sunyaev–Zeldovich effect and 2MASS galaxies: probing gas physics in the local Universe and beyond | Synapse