I want to boil tap water and use tea bags but since summer is coming I want to make it cold. Is it safe if I let it to get to room temperature and then put it in the fridge?
Please see Food Safety News: Did You Know Iced Tea Safety which gives the very strict FDA guidelines for iced tea as:
while pointing out that "Tea is a beverage with little history of disease transmission."
Applying some common sense, assuming that you:
given that tea does not have a huge number of nutrients to encourage pathogen growth, the risk should be minimal, although non-zero.
You must assess your own tolerance for risk, but this is not an activity that is inherently highly dangerous.
Finally, please note that modern refrigerators perform very well, and there is minimal heating of the other foods, even if you put a fairly large volume of tea in the refrigerator to cool. See: How effective are modern home refrigerators at keeping other foods cool when hot food is introduced to the space?
From a food safety perspective the main question is whether you add sugar while it is hot, or after it is cold. Sugar will feed pathogens, so if it is sugared while hot you are better off chilling it quickly rather than letting it cool to room temperature, as it will take a long time to do so. While it cools any pathogens will have time to grow for a long time at optimal temperature.
From a taste perspective letting it cool to room temperature is a bad idea as it will lose freshness and flavor, chilling it as quick as you can will give you a better result. I've had good results using re-usable ice cubes although they don't last and take up space. My preferred method of rapid cooling is to put a metal pot plus a bunch of big spoons and stainless steel flatware into the freezer, letting them get nice and cold, than pouring the hot tea into the pot. The cold metal absorbs quite a bit of heat very quickly, then the tea can be poured into a storage container and put into the fridge. A quick rinse and the pot and flatware are ready to use again.