First reboot your computer to see if that fixes the problem. When your computer has booted, if you still have the same problem, Ubuntu may have told you that it cannot start X. If you did not see this message, press Ctrl-Alt-F7 to see if you can access the graphical interface. If this does not work, there is a configuration problem with X.
X stores its configuration in /etc/X11/xorg.conf. Before you fiddle with your configuration, it is always wise to make a backup of the file. Even if X is not starting, some other parts of the configuration may be working fine.
foo@bar:~$ cd /etc/X11
foo@bar:~$ sudo cp xorg.conf xorg.conf.old
First you move to the /etc/X11 directory and then you use the cp command to copy the existing file (xorg.conf) to a backup file (xorg.conf.old). You now have both an xorg.conf and an xorg.conf.old with the same information in them.
Now run the X configuration process:
foo@bar:~$ sudo dpkg-reconfigure xserver-xorg
A configuration routine will start, and you should experiment with different settings in the routine. Unfortunately, we don't have the space to cover X configuration in detail, so refer to https://wiki.Ubuntu.com/DebuggingXAutoconfiguration.
Ubuntu only ships with fully Open Source graphics drivers. There are, however, closed source drivers available for ATI and NVidea cards. For more information about these drivers, visit the respective manufacturer's Web site.