The TJ's instrument panel has two big multi-pin connectors immediately behind it that work loose and cause that problem. Remove the instrument panel, it pulls straight out after 8-10 screws. Once out, take each male pin and give it a tiny pinch with needlenose pliers to very(!) slightly flatten each pin so it will make a better contact into its female mate. Once done, this should cure the problem pretty much forever. I did this to my TJ nearly 9 years ago when it was still nearly new and it fixed it completely.
This fix is very commonly done, no worries.