This depends on the condition and while the rule of thumb is that cold is best when there is swelling or acute injury and heat is best for tight muscles or stiff joints. If either heat or ice increases the pain or other symptoms you should stop doing it immediately and seek professional help.