Validation Based on value of another field

I have an email field and a Confirm email field. How can I validate that the value in both field are
the same