What to do after a miscarriage

A miscarriage typically happens within the first trimester of the pregnancy and can be caused by different reasons. But what do you do when you lose a child you really wanted? How do you cope?