If you asked students of English coming from different parts of the world what posed the biggest problem to them when learning English grammar, they would probably come up with the same answer: usage of articles. The principal difference between the two is: we use a (the indefinite article) to speak generally and the (the definite article) when we need to be specific. However, it can be quite demanding to determine when something is specific and when it is not. Fortunately, certain usages of the articles are well described.
One of these is the usage of the definite article with various institutions. The overall rule is pretty simple: when we are talking about the normal purpose of an institution (e.g. of school, prison, hospital) we use these nouns without the definite article (e.g. My son goes to school in Novi Zagreb; The guilty men were sent to prison; He was taken to hospital because he felt sharp pain.) On the other hand, when we use these nouns in order to refer to a specific building we use the (e.g. Last month they went to see the school built by Le Corbusier; He often visits the prison where his brother works; We heard that the hospital was to be built next to our building).
These examples make sense if we think about general rules for the usage of articles. The most common examples are nouns like school/collage/university, church, court, hospital, prison. We can extend this rule to a number of similar nouns like bed, home, work, sea. When these places are used or visited for their primary purpose, the is not used. However, when these places are visited or used for other reasons, the is necessary. Notice the difference between these two usages: I’m usually in bed by eleven. The bed felt very comfortable. In the first sentence in bed means ‘sleeping’ and the bed from the second sentence means a specific bed.