Hello,
As you have said, -dir is mainly used in formal speech/texts. It is a suffix that is used when articulating a certain thing, like a "fact". In this context we could use it in a sentence like "Türkiye'de her gün 15 kişi trafik kazalarında vefat etmektedir". In this sentence we are giving an explanation about a fact i.e everyday 15 people die in car accidents in Turkey.
Besides this usage, in our daily language, we use -dir when we are making a guess (when we are not sure about the info we are giving)
Let's say the question is "Yeğenin nerede?"
The answer would be "Okuldadır", making a guess/suggesting that he must be at school as he would generally be at this time of the day.
I hope this helps.