Things You'll Need
Instructions
Turn off the controller, if necessary. Check the LEDs on top of the controller to make sure none of them are lit. If they are lit, you can turn it off by pressing and holding the PS button and selecting "Turn Off Controller" from the on-screen options. If you can't access those options turn off the PS3.
Reset the controller. The reset button is on the bottom of the controller near the L2 trigger button. The button is in a small hole in the controller so you'll need to use a small object like a paperclip to reach the button.
Turn on your PS3 if it's off.
Plug the controller's USB cord into a free USB port on your PS3 and into your controller.
Press the PS button on the controller. The LEDs will begin flashing, then one will remain lit to indicate its number. You should probably check its battery charge level to see if that was causing the issues connecting it. Press and hold the PS button for a couple of seconds to bring up the battery information on the screen.