Y replaces à + a place, or à + a thing (not a person), and usually corresponds to "there" or "about/of it": tu vas à Paris? Oui, j'y vais (are you going to Paris? Yes, I'm going there). It's placed before the conjugated verb, exactly like the object pronouns.
Y also replaces à + a noun with verbs that take that preposition, like penser à or réussir à: tu penses à ton examen? Oui, j'y pense (are you thinking about your exam? Yes, I'm thinking about it). Y and en frequently appear together in the fixed expression il y en a (there is/are some of it).