The consumer optimum is the point on the budget constraint that lies on the highest attainable indifference curve, achieved where MRS = P_x / P_y (the indifference curve is tangent to the budget line). At this point, the consumer's subjective valuation of one good in terms of the other exactly equals the market's exchange rate. Interior solutions require this tangency condition; corner solutions arise when the consumer spends all income on one good. The optimum is also described by the equimarginal principle: MU_x/P_x = MU_y/P_y.
Solve consumer optimization both graphically (find the tangency) and algebraically (use the two conditions: MRS = price ratio and income exhaustion). Use Cobb-Douglas utility functions for tractable algebra.
You know from indifference curves that higher curves represent higher utility, and from the budget constraint that the consumer can only choose combinations on or below the budget line. The consumer optimum is the answer to a simple question: which affordable combination lies on the highest possible indifference curve?
Graphically, this is a tangency problem. Most points on the budget line cut through an indifference curve — they cross it, which means a nearby point on the budget line lies on a higher curve. The only point where no such improvement is available is where the budget line just touches an indifference curve without crossing it: the tangency point. At this tangency, the slope of the indifference curve equals the slope of the budget line, giving the condition MRS = P_x/P_y.
The economic intuition behind this condition is elegant. MRS is the consumer's personal exchange rate — how much Y they would willingly sacrifice for one more unit of X and remain equally satisfied. P_x/P_y is the market's exchange rate — how much Y they must actually give up to purchase one more X. If your MRS is 3 (you'd trade 3 units of Y for 1 unit of X) but the price ratio is only 2 (the market only requires you to give up 2 Y per X), you should buy more X: every unit costs you less than it is worth to you. You keep buying until subjective and market rates equalize — that is the optimum.
The same condition can be written as MU_x/P_x = MU_y/P_y, the equimarginal principle: equal marginal utility per dollar spent on each good. Think of it as "equal bang per buck." If the last dollar spent on X generates more utility than the last dollar spent on Y, shift a dollar from Y to X; you gain more than you lose. You stop reallocating when the per-dollar marginal utilities are equalized across all goods purchased.
Two important qualifications: Corner solutions arise when the budget line is always steeper (or always shallower) than the indifference curves throughout the feasible region — the optimum is then at an axis endpoint, with all income spent on one good, and MRS need not equal the price ratio. Also, the tangency condition is necessary but not sufficient for a maximum: with non-convex preferences, an interior tangency can be a utility minimum. Standard microeconomics assumes diminishing MRS (convex indifference curves), which ensures the tangency is a maximum — but it is worth knowing this assumption is doing real work.