I'm in my late 50s now. When it started to be evident that I wasn't going to have children, I did some serious thinking about why it was that I wanted them. For me, I realised that I didn't think it was a good idea to have a child just to meet my own emotional needs. I don't think it is a good idea for any child to be used in that way ( reflecting on my own childhood here). I did some wondering about what I did think would be a good reason to have a child. I realised that this would be if I felt I had more love to give, that I wanted to give to a child.
So then I reasoned that, if I had love to give, I could either spriral down and down because I wasn't going to have my own child or I could get out there and love the children I did come into contact with.
For me this meant giving time and energy to children at church and children of friends. Covid lead to me bubbling with a family with 3 under 2s and being able to support and help their parents during a very tricky time. I still get to see the girls and spend time with them most weeks and love them dearly.
I also have 2 " honorary nephews" who are children of friends and that I love to bits.
Of course this is not the same as having my own children and there has needed to be some adjusting and sensitivity to the different ways that the parents want to bring up their children (probably in a similar way to Grandparents, making sure you are not offering unwanted advice etc) and there is still a grief sometimes that you don't have a 'primary' relationship with a child, however, for me it has led to me feeling I have some of what I want in connecting with and giving love to children. I enjoy my time immensely with them but it is also exhausting ( I have a chronic illness that causes fatigue) and I also enjoy and appreciate being able to lie down in a darkened room afterwards!
I'm not saying this is an answer for everyone, just that it is what I have found helpful.
I wanted to add that you may want to watch out for an unexpected grief that hits you later on. The awareness that I wasn't going to have a child was gradual and I could see it coming on the horizon. This meant it wasn't such a shock to me and I had time to process it.
Now my peers are starting to have grandchildren. One morning when 2 separate people were talking about how wonderful it was to be a grandparent for the first time, it suddenly hit me that I was never going to be a grandparent either. That was a very sudden and unexpected grief that blindsided me rather.