I learned that we use definite article 'the' to tell A from B. But I don't understand the reason why we put 'the' after preposition like ' in the room.' I would like to know whether We should put 'the' after a preposition to tell the room from other room that we don't know or to tell the room from other kinds of space like a classroom. Please, give me the answer.
To use your example of "in the room":
"In the room the women come and go, talking of Michelangelo".
The definite article tells the listener that the speaker has a particular room in mind, not just any room.
In English, the speaker might have said:
In a room the women come and go...
but it would mean "in some room, one which I do not recognize or one whose particular identity is not relevant to what I am saying at this moment..."
In English, we cannot say:
In roomungrammatical the women come and go...
English listeners expect the speaker to indicate whether he or she is talking about a particular room or not.
In the room on the third floor... a particular room on the third floor. The speaker would expect the listener to know which room, perhaps from the speech context or from being generally familiar with the house, or from some other context.
In a room on the third floor... one of several rooms on the third floor, and which one is either not known, or irrelevant, or both unknown and irrelevant:
Your precious painting is in a room on the third floor. Don't worry, the flood waters will not reach it.