When the Operating System crashes you will get the message 'You need to resart your computer'. This is a kernel panic. It's rare and, thankfully, often fixed by restarting.
If not, try unplugging all add-ons from your Mac and restarting. Internal upgrades - including dodgy RAM - can provoke kernel panics, as can devices such as USB hubs.
Another possibility is that a system file has become corrupted. Restart while holding X; if this works, go to System Preferences, click Startup Disk and ensure the correct disk is selected. Or, restart holding down ALT key, releasing it when icons appear; you'll be asked which disk to start up from. Or zap the PRAM. (see other Solution).
If none of these work, perhaps you've moved, renamed or deleted a system file. Reversing this may sort it out - or not. The last resort is to reinstall Mac OS X. Start up from your Mac's OS X DVD, run the installer and choose Archive and install. You'll need to reinstall your apps though.