Add Xiaomi Temperature and Humidity Sensor

Where do you put this code?
I’m new to home assistant and cant understand wich file to put all the code into?

/Tomas