The only way a phone would have a password is if someone assigned it one. Either it would be you, if you are the original owner, or it would have been done by the original owner. If that is the case, then you need to ask that person the password.
If you are the original owner, then either you assigned it or the manufacturer did (which would be rather odd) and you would have to contact them.
NOTE: WiFi and Safe Mode neither have anything to do with a password on the device. Now the WiFi could need a password to access it. Most do unless they are open public ones. Safe Mode however doesn't involve passwords at all.
We, however, cannot help in bypassing any passwords. Please read the following thread...