Low Battery
If you continuously use the controller in its wireless form, its batteries will run down and the controller will eventually stop working. The batteries charge through the PS3 console when it is connected through its USB cable. The console needs to be on to recharge the controller, so occasionally playing games with the controller connected will help keep the controller batteries charged. The controller has a warning light to indicate when the batteries are low.
Syncing issues
The controller will have issues working with the console if it is not synced properly. To sync the controller, plug it in and press the controller's "PS" button. It can also help to plug the controller in before turning on the console and syncing the controller.
Need for Reset
The most common sign of trouble with the controller is seeing the four lights flashing. If you have tried the aforementioned methods and the lights are still flashing, you may need to reset the controller. This requires a straightened-out paperclip or a pin. Locate the reset button hole for the controller, which is on the right side of the rear, and insert the pin/clip into the hole to press the button.
One of the most effective "last resort" options is to give the system a "hard reset," switching the console off manually with the switch in the back, flipping the switch back on and then holding down the console's power button until you hear three beeps. This will revert the console to its default settings, so you will need to back up all information you have saved on the console system.