If bare wire is exposed, as you see here:
Remove the prong from the plug (unless it has already fallen out, as above). Use a small pliers if necessary.
Thread the exposed wire into the hole in the plug from the bottom.
Then insert the prong from the top.
Use a pliers to push the prong all the way in. Be sure the exposed wire stays inside the hole and is in contact with the prong.
If the cord has come loose and bare wire is NOT exposed, as you see here:
Strip off the white covering on the cord to reveal about 1/4 inch (6 mm) of bare wire. Do this by first making a slight nick in the covering with a craft knife, being careful not to cut all the way through.
Use your fingernails to pinch off the white covering. Follow the steps above to insert the wire and prong back into the plug.
ALERT: This process can be fiddly and frustrating! Take breaks and know that it may take a few tries--and a few choice words--to get it right. Good luck!