First go to the pg_hba.conf file and open it in any editor (notepad or notepad++).
Location of pg_hba.conf is mainly
C:\Program Files\PostgreSQL\9.3\data
Change method as md5 to trust
#TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
Instead of
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
then save it.
Run Command prompt as administrator and goto
C:\Program Files\PostgreSQL\9.3\bin
directory through cmd.
Run reload postgres service command
pg_ctl.exe reload -D "C:\Program Files\PostgreSQL\9.3\data"
Got to PgAdmin and connect localhost database without using password

Go to the properties

Change the password in Definition tab

Then again change method trust to md5 .
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
Again Run reload postgres service command
pg_ctl.exe reload -D "C:\Program Files\PostgreSQL\9.3\data"