If the thermostat you have is a Google Nest Thermostat, then you set it up on your Google Account and follow device access documentation. (https://support.google.com/googlenest/answer/9893532)
If it is a thermostat that you are building take a look at the cloud to cloud APIs. (https://developers.google.com/nest/device-access/api/thermostat)