A consumer shall be in equilibrium where he can maximize his utility, subject to his budget line are target to each other (i.e. where their shapes are equal, the consumer would be in equilibrium as that combination of the goods X and Y gives maximum satisfaction to the consumer that is, this is the highest indifference curve a consumer can reach within his available budget. This is shown in the following figure.
In this figure the budget line AB passes through point r, P and Q point R and Q lie on lower indifference curve (IC1) therefore these can not be the equilibrium point. The point P lies on Ic2, which is higher to IC2, which is highest to IC1. IC2 highest attainable indifference curve and it is tangent to the budget line AB. Indifference curves higher are beyond the available budget of the consumer.
At equilibrium point P, the slope of budget line is equal to the slope of indifference curve i.e.
Px/Py = MRSxy
Thus the rational consumer will find that equilibrium the rate at which he can exchange Y for X (i.e.Px/Py ) should be equal to the rate at which is willing to substitute Y for X (i.e. MRSxy).