Login to your Yahoo! account via a web browser, go to your account section and then change the passcode. Afterwards, delete the account on your iPhone and then reconfigure it using the new passcode or wait for it to prompt you for the new Yahoo! passcode.
I just did this on my 6s. I had to delete my old account and then add it back with new password. It was easy enough (once I figured that out). On my iPad 2, I was able to change the password without having to delete it.