With the ordinary axes (x across, y up), three of the forces point along awkward directions, and so does the acceleration. You would have to break up FN, the friction, and the acceleration into components. That is three jobs.
With the turned axes (x′ along the slope, y′ perpendicular to it), FN lies entirely on y′, friction lies entirely on x′, and the acceleration lies entirely on x′ — because the block can only slide along the ramp. Only gravity is left to break up. That is one job.
That is the whole reason we rotate. We choose the axes that make the acceleration point along one of them. The CED says so outright — “a coordinate system with one axis parallel to the direction of acceleration simplifies the translation from free-body diagram to algebraic representation” (2.2.B.4).
Where the sine and cosine come from. Turn on The equal angles. The angle at the base of the ramp and the angle between Fg and the perpendicular are the same angle — their arms are mutually perpendicular.
Once you see that, the triangle reads straight off: gravity is the hypotenuse, so the side next to θ (into the slope) is mg cos θ and the side opposite θ (down the slope) is mg sin θ.
Don't memorize which one is which — check it. Slide θ to 0°: the ramp is flat, nothing pulls you along it, and the floor holds your whole weight. So the along-the-slope piece must vanish and the perpendicular piece must be the full mg. Only sin 0 = 0 and cos 0 = 1 do that.
Now slide to 80°, nearly a cliff: almost all of gravity pulls you down the slope and the surface barely presses back at all.