Check the Connections
Start by checking all the connections. Make sure the pad is fully plugged in and that the plug is not wiggling loosely in the control port. Likewise, if the pad is plugged into an adapter or multiport, make sure that those are securely plugged into the console or computer. If any of these plugs feels loose in its ports, the pad may not be making a solid connection. If this is the case, you should test another dance pad in the same port, or test the same pad in a different port, to find out if the pad or the port is the source of the problem. If the pad is the source of the problem in this case, it will likely need to be replaced.
Switch Ports
If all the connections are solid, try switching which control port the pad is plugged into. If the pad works in the other port, the original port itself is probably the cause of the issue. Note that, because of the vagaries of game system design, it is sometimes possible for a control port not to function with a dance pad but work normally with other controllers. You can also try plugging a different pad into the same port, if you have another. If the new pad works, there is probably an issue within the original dance pad.
Test With Other Systems
Note whether or not the pad has ever worked. If not, there could be two causes: The pad could be broken or defective, or it could be incompatible with the system you are using. This latter issue is fairly common when using third-party and off-brand dance pads, the manufacturers of which often do a poor job of documenting exactly which systems and accessories the pad is and is not compatible with. The only way to really test this is to try using the same pad on different systems and, in the cases of multiports and adapters, different accessories.
Flatten the Pad
If you are using a soft dance pad, unplug it and lay the pad flat and face down for a while, with even pressure over the entire mat. A futon mattress works well for this, as does an upside-down folding table. Soft dance pads sometimes develop creases, making the pad difficult or impossible to use. This will be especially likely if the pad has been stored folded up.
Change Surfaces
Try using the pad on a different surface. Due to their varying designs, different pads work better on different floor surfaces. In particular, many soft pads can become difficult to operate on carpet or other soft materials.
Check for Damage
Check the whole pad for any discernible damage. Any visibly cracked wiring, significant tears in the outer pad material, or breaks in hard casing may indicate broken wiring within the pad. However, note that internal components can and will break without any external indicators. If you notice damage to the pad, or if the pad simply will not function properly no matter what you do, there is a good chance that the pad has suffered internal damage. This can be repaired in some cases, and in the cases of expensive hard pads the cost of having it repaired may be justified, but most dance pads are inexpensive enough that, in the case of a broken pad, it is better simply to replace them.