En replaces de + a noun — most often a quantity, a partitive article (du, de la, des), or the object of a verb that takes de. It corresponds loosely to "of it / of them / some": tu veux du café? Oui, j'en veux (do you want coffee? Yes, I want some).
En is also required whenever a quantity is mentioned without repeating the noun: as-tu des frères? Oui, j'en ai deux (do you have brothers? Yes, I have two — literally "I of-them have two"). Leaving en out here is a very common mistake for English speakers, since English is happy to just say "I have two."