You should store the password in a hashed form. In that way you won't be able to reverse engineer it to get the original password. Now you might ask why do a one-way hash for storing a password? The thing is, you don't want anyone to reverse engineer your data in your db. Even if someone has an access to your DB they still won't be able to know the actual password. Now talking about how to verify the password if you yourself can't get the Original password.
The thing is, you don't have to. You just have to let the user enter his password, the you hash the entered password (And since a hash on same data will always generate same hash) you can easily verify whether the password entered by the user and hashed by you matches the already hashed and stored password.
In simpler means you have to take a password p and store it in DB as hashed password hashed_p while registration. Now while you want to login or verify the password you again ask the user to enter the password. Now you will hash password p entered by the user and generate a hashed password hashed_p. And then you will compare this hashed_p with the hashed password hashed_p on your database.
So to verify you will have to check if the hash of the password entered by the user is equal to the hash of the password stored in DB. That's how hashing of a password works.