Show that X is a Hausdorff space iff. the diagonal is a closed set in the product space.

Suppose X is a Hausdorff space. Then such that there exists neighborhoods of , respectively, such that .

I don't know how I am supposed to use this to conclude the other piece.