You will need to have the security key/password to the router/modem that is being used to connect via WiFi. If you don't have that, or are entering it incorrectly, then it won't work.
If it is your own router/modem, you should be able to verify the password by logging into the devices data. If it is WiFi from someone/somewhere else, then you will need their info.