Pregnancy loss 40 weeks

Basma

I was 40 weeks pregnant on my due date i felt some contractions i told my doctor the contractions & he told me I should go to the hospital I went there the assistant told me that i am not dilated & there is no water broke, & he made the sonogram the baby’s heart beats was normally fine & beating so he let me go home & wait its not a labor after an hour of pain a little water have came out i went down to the hospital the baby’s heart beats has stopped out

I am not feeling well & I don’t know what happened made the baby’s beats stop