"Let me explain. The happiest man on earth would be able to use the Mirror of Erised like a normal mirror, that is, he would look into it and see himself exactly as he is. Does that help?"
Harry thought. Then he said slowly, "It shows us what we want... whatever we want..."
"Yes and no," said Dumbledore quietly. "It shows us nothing more or less than the deepest, most desperate desire of our hearts. You, who have never known your family, see them standing around you. Ronald Weasley, who has always been overshadowed by his brothers, sees himself standing alone, the best of all of them. However, this mirror will give us neither knowledge or truth. Men have wasted away before it, entranced by what they have seen, or been driven mad, not knowing if what it shows is real or even possible."

Harry Potter and the Philosopher's Stone - Chapter 12 : The Mirror of Erised
See this quote in the Pensive -