When to use (in) or (at) ? what is the difference between these two prepositions?
They are difficult. Generally, we use "in" for two spatial types of situation: domestically, it is used to describe the part of the home in which a person is located: "I am in the living room." "Mom is in the study."
Outside of the room-scale view of the home, on the large scale, we use "at" to represent locations that frequently change, and that we expect to change often (at school, at home, at the dentist's office, at the shopping centre); and we use "in" to represent places so large we are not expected to move in and out of them often (I live in Toronto, I am currently in Canada) etc.