First of all,

it sounds like you are going through hell. I am so sorry.
OK, figure out if anything can be done through his attorney. I don’t know if you can do anything since the court might be thinking protect your son.
You can do this. You just throw yourself into working. Do you have a job?
I did this when my husband died. I didn’t take more than a week off; I just worked and did my best not to think. It was really, really hard, but I was able to get through it by focusing on work. It was the time at home when I would suffer. I tried to keep busy to keep my mind off of everything.
I went to a grief support group
Maybe you could go to a mental health support group? Ive seen posts here about DBSA and NAMI groups.