If it at&t you could just look on the side of the wifi box and it will be in the bright yellow sticker. It will have the wifis name first, underneath the name on the sticker it will say password and appear to look like a mixture of letters, numbers and values ex. Dtgf4%2etf or so.
Who did you get WiFi from so I can help you further.
If it's a business with available wifi ask an employee or the front desk. If it is a personal residential wifi then you must ask the one who pays the bills for the wifi. Lol most will be password protected as they should be.