When you look for the x-intercept given a question, you set y=0 then solve for x. Why is that?

Well, when the line goes through the x axis instead of the y axis you set the y-coordinate to 0, because you’re finding the x-intercept not the y-intercept

example: (4,0)