Validating password and re-entered password in signup

hello, wanted to know how to validate and check whether the password entered and the re-entered password to confirm are matching in the sign up page.