A reference is something that refers or points to something else, or acts as a connection or a link between two things. The objects it links may be concrete, such as books or locations, or abstract, such as data, thoughts, or memories.
In semantics, reference is the relation between nouns or pronouns and objects, or between speakers and objects. Hence the word "John" refers to John; the word "it" refers to some previously specified object. Alternatively when I say "John" I refer to John. Sometimes the former, word-object relation is called "denotation" for clarity; still, speakers only refer by using words that denote. The objects referred to are called the "referents" of the word.
Reference is not in general the same as meaning, since many words, including verbs and adjectives, do not refer at all but are perfectly meaningful. Furthermore, as Frege discovered, reference cannot be treated as identical with meaning even for nouns: "The morning star" and "the evening star" both refer to Venus, but it does not seem to be the case that if I do not know this I must not know what my words mean. (This led Frege to distinguish between the sense of a word and its reference).
In computer science, referencess are datatypes which refer to an object elsewhere in memory, and are used to construct a wide variety of data structures such as linked lists. Most programming languages support some form of reference. See reference (computer science).
A reference point is a location used to describe another one, by giving the relative position. Similarly we have the concept of frame of reference (both in physics and figuratively), etc.
In a library, the word reference may refer to a dictionary, encyclopedia, or other reference work that contains many brief articles that cover a broad scope of knowledge in one book, or a set of books. However, the word reference is also used to mean a book that cannot be taken from the room, or from the building. Many of the books in the reference department of a library are reference works, but some are books that are simply too large or valuable to loan out. Conversely, selected reference works may be shelved with other circulating books, and may be loaned out.