The only way was to consciously try.

After my first mc, I had a hard time bonding with DS1. He wasn't very active, but I think I was just stressed. When he died, I really regretted that I'd wasted so much energy in fear of losing him. It made no difference, we lost him anyway.

When pregnant with DS2, I tried hard to talk to baby, to sing to him. I wanted to cherish every moment we had, no matter how few. He was a very active baby anyway, so it made it easier. Even then, it wasn't until we found out he was sick and that he was a boy, that I really started to bond. We lost him and no trying to protect my heart made a lick of difference there either.

I have heard that if you have ante-natal depression, it makes you more at risk for post-natal depression. That it can be harder to bond after birth if you dont start during pregnancy. I wouldnt beat yourself up about it though. You will bond with baby, either now or later. Many men dont bond with baby until after they're born and that seems to be fine. Maybe let your care takers know to keep an eye out for PND afterwards.

I used to love playing music to my babies whilst having a bath and singing to them. Maybe that might help you.