A preposition introduces a prepositional phrase--that is, a word-group that functions (usually) as an adverb or adjective and consists of a preposition together with a noun, noun phrase or pronoun. In function the preposition is somewhat like those conjunctions that introduce adverb and adjective clauses: it defines the relationship between the sentence-element the phrase is modifying and the nominal element the phrase contains, and it also identifies the field (time, space, sequence, comparison, etc.) in which that relationship occurs.

In a sentence like this one

Fishes swim in the water.
the prepositional phrase "in the water" acts as an adverb modifying "swim." The preposition "in" tells us that the phrase has to do with space and, more precisely, location relative to "the water." Other prepositions work similarly, modifying nouns and verbs by defining the relationships between them and other things.

The noun, noun phrase or pronoun that follows the preposition is called the object of the preposition. The object of a preposition will generally be in the accusative or the dative case (rarely the genitive), depending on the preposition or the meaning it has in context. Your textbook should tell you the case that each preposition takes.