Just because your PlayStation 3 has frozen does not mean that something is seriously wrong with it. Sometimes glitches just happen -- maybe your PS3 overheated or maybe the game itself locked up but the console didn't. If your PlayStation 3 has frozen during the middle of a game you will definitely lose all unsaved game data, but you won't lose the ability to use your console.
Press the "PS" button on your controller one time. If the on-screen menu appears, highlight and select the "Quit Game" option to close out of the frozen game. Select the icon for the game again in the "Game" menu to reload the title that was previously frozen.
Hold down the "PS" button on your controller. Continue to hold down the button until the system menu appears. Select "Turn off the System" from the system menu. This will completely turn off your PlayStation 3. Press the "PS" button again to turn the console back on. Try to play your game again.
Press and hold the "Power" button on the front of the PlayStation 3. Hold it down until you hear two beeps, at which point your PlayStation 3 gaming console will restart itself. Select the icon for your game from the "Game" menu on screen and attempt to play again.