Well this is not a task that you can take on by yourself. You will need to go to the Doctor and make an appointment if you have insurance. If you do not have insurance you may be able to go to the hospital or go straight to the orthopedist.
Try not to move your body and stay still, call someone to help you bring yourself to the hospital and get an x-ray. A professional medical intervention is best for this case home remedies are highly not advisable.
If your rib is out of place,tape or otherwise hold the side steady by some sort of bandage or binding until you go to the doctor. Extreme care should be taken until it gets immobilized.
You need to talk to a doctor about this because if it has been broken and somehow has grown back together wrong you may need to do something to make it straighten back into place or they may need to rebrake it.
This is either a broken bone or a dislocated one. You need to see a doctor to put it in its proper place, as well as to verify that there is no internal damage.