The first step is possible because the polygons are similar. Similar figures have their corresponding sides be in the same proportion or ratio. Note how side AC has the double red angle (at point A) and a single red angle (point C). The side QY has the same idea in the same order. This is why AC corresponds to QY. The ratio AC/QY is the same as CD/YW.
In the second step, I plugged in the expressions that the diagram shows. This is the substitution property.
On step 3, I cross multiplied. The general format is A/B = C/D cross multiplies to A*D = B*C.