The consumer’s optimal choice is on the budget line itself, not inside the budget constraint. This is why we can focus on the line rather than the whole set of affordable bundles. At the optimal choice, the indifference curve just touches the budget line, and so at this one point, they have exactly the same slope.