Consult a maxillofacial surgeon a dislocated tmj has to b corrected it may not settle on its own if you have a xray send on line a picture of that than can adv you better what's the age n how did it happen is it first time or it had occurred earlier write these details to understand your case better.
You mean you have pian in TMJ? Do not eat hard thing, take soft thing only. Do not try to open your mouth wide, support your lower jaw with your hand while opening your mouth. You can apply hot wet cotton with warm water over TMJ area.
You have pain in temporo-mandibular joint. Do not eat hard thing, support your lower jaw with your hand while yawning. You can apply warm water wet with cotton over TMJ. You can take analgesic. If pain persist more then one week consult a dentist nearby you.