There is no legal way for you to make sure that you can see your grandchild. The only way that you can pursue that remedy is through what I call self-help. That means that you need to keep on the good side of both parents while they’re still married. Do not take sides with either parent during the course of the divorce, try to remain neutral, and then after the divorce, try to maintain a cordial relationship with both parents.
The reason for that is the parents have the ultimate decision on who sees their children, including grandparents. It’s all voluntary on the parents part. All you could do is try to affect self-help by keeping cordial relationships with the parents.