You are probably in a state of shock. This is normal; it will take time to process what has happened to you.
I have far too much experience of the psychological impact of things like this (two preterm labours, leading to two stillbirths).
My advice would be ...
No alcohol or sodas for the foreseeable future.
Cut down on caffeine, or give it up completely.
Eat shit loads of veg: colours, leaves and cruciferous.
Don't eat processed food: foods with high sugar are a bad idea.
Get enough sleep: between 7 and 9 hours a night. If you feel tired during the day, nap.
Drink two litres of water a day.
Take a weekly epsom salt bath with lit candles.
Take a daily multivitamin.
Take time to relax. I find "mindfulness" meditation invaluable. If this isn't something familiar to you, look for a good accessible book to help you learn the principles.
Get moving. As soon as you are healed, start taking regular exercise. Swimming is good. Even just ten minutes on a stationary bike three times a week is a good thing.
Get into nature. Walk in a park. Get out to see grass and trees, and feel the wind on your face. It is a good idea to make time to be on your own in a nature environment, even if it is raining. This is a way to ground yourself and your body, and help your nervous system to become "unstuck".
Sing. Yes, I know this sounds weird. If a song you like comes on the radio, sing along. If you don't want to do this, you can tonal hum in the shower. For some reason, this works when your head starts to feel pressured and heavy.
Draw. Get a pencil and some paper and just doodle. It will get your head out of your head and into your fingers and eyes, iyswim.
I found I needed time on my own in the house. For some reason, I would get "stuck" if DH was in the house; when he left, somehow I could finally get out of bed and do things.
I also binged-watched boxsets on my phone in the evening with earphones in because it took me out of my head for a while.
Also, connect with new people. Join a club or a class where there are people you don't know and just smile and say hello. You don't need to "make new friends", you just need to connect with a smile.
You also need to do something that gives you a sense of your own ability to affect change. One of the problems with events like these is the sense of existential helplessness you can get, because something traumatic has happened to you that you had no control over. You need to counteract this.
One thing I will say is ... don't make any big decisions for a year. Don't decide to move to Jamaica, cut all your hair off, or change your name to Dave.
Another thing I will say is that I found that changing ritualistic patterns helped me. This is kinda against some advice, but I found it helped to "break the shell" of the shock. I started driving a different way to the supermarket, getting up at a different time, taking a shower at a different time, going to work on a different train, eating in a different place in the house.
I hope some of this helps. You can get through this. It will take time. Some days will be better than others.
Another small thing ... you will realise that you are a different person now. That the loss of your pregnancy in the manner in which it has occurred, involving surgery, has changed you as a person. Don't fight this. See it through the lens of new possibilities.