If it is the first case, it is necessary to have a rest, let the joints brake properly, and find the appropriate amount and degree of exercise in the future to avoid this from happening again.
The second case needs active treatment, otherwise it may further aggravate joint pain and dysfunction.