Missed miscarriage

I had a missed miscarriage and d and c almost three weeks ago. I finally got the go to have sex, and I wanted to. But then when we did I cried and was just so sad that we had to use protection and things had come to this. I'm sure it'll get better, and my heart will be in it. But how long did it take for you to feel like yourself? And how long did you wait to ttc again? Having a really tough time so any advice on the subject if helpful.