X-Wing step by step
Consider digit 5. In row 2 it can occur only in columns 3 or 8. In row 7 it can also occur only in columns 3 or 8. Two valid arrangements remain: r2c3 and r7c8, or r2c8 and r7c3.
Either arrangement occupies columns 3 and 8 with those two fives. Therefore 5 can be removed from every other cell in those columns.
Recognize the pattern correctly
Find a digit with exactly two candidate positions in each of two rows. If the columns match, you have the basis of an X-Wing. The technique also works with columns and rows exchanged.
X-Wing eliminates candidates; it does not immediately determine which of the four corner cells is filled. Recheck singles and pairs after the elimination.