You may want to forget a specific Wi-Fi network if you do not want your Android device to not only automatically connect to it but to delete saved credentials as well.
Removing such information as Wireless Security Key and security mode (WPA3, WPA2, WPA, WEP) will prevent your device from ever connecting to this hotspot unless you know the password and manually type it again.
It can also help in troubleshooting some problems related to wireless networking – for instance, Saved, Secured issue.