Below is archive link which has reference on how to set up raspberry pi 3B+ in headless mode. It will will also help in setting up ssh and wifi if required.
To update the default password:
passwdcommand to update the password or add your ssh public key to
To add ssh keys for login: You can also your public keys for ssh, which give seamless way to login without password hassle, but then you need to have ssh keys to login.
cat <pub_key> >> authorized_keys