Tropical fish thrive between 25 °C and 27 °C. They can tolerate lower and higher temperatures, but 40 °C would kill them in short time. Aquarium chillers do exist and are adjustable for temperature. There are also some homemade designs out there. Here is one I found (on thespruce.com).
Good luck - I hope you can set up an aquarium! They are really rewarding.