@raviflat105,
Going to e.g. school, university or prison etc (also hospital in UK English) are activities as Setanta says, and can be spoken of without an article:
1.
I went to school - acceptable - omit the article to talk about a period of attending school: I went to school in England; I went to school from 1995 to 2006
I went to a school - acceptable - use the indefinite article 'a' to talk about a school in general terms: I went to a school that was 100 years old; I went to a school where only boys were educated; I went to a school which had a good sporting record.
I went to the school - acceptable - use the definite article 'the' to talk about a particular school: I went to the school next to the park; I went to the school previously attended by Charles Dickens.
2.
I went to library - not acceptable.
I went to a (or the) library: acceptable.
3.
I went to police station - not acceptable
I went to a (or the) police station - acceptable