Settings not opening in Ubuntu 20.04

I found a solution to this:

Go into terminal and type:

xrandr --auto

If that didn't work try typing:

xrandr --current

You will get a list containing vga, vga1... with most of them displaying disconnected.

Ignore LVDS-1 connected and search for the other one that has connected; most likely it will be VGA-1.

If so then type the following command:

xrandr --auto && xrandr --output VGA-1 --off

Please note that I have given VGA-1 as it was in my case, but you may have to change it to whatever you find connected other than lvds-1.