Two kinds of denial
Sometimes the denial is a parent's decision and no court has been involved yet. Other times a court has heard a petition and ruled against you. New York gives grandparents standing to ask for visitation when a parent has died or when circumstances show that equity should step in, which typically involves a real, existing relationship with the child that a parent has blocked. Even with standing, the court decides based on the child's best interests, and a fit parent's wishes receive significant weight because of constitutional limits on interfering with parenting decisions. A refusal by a parent is therefore a possible starting point for a petition, not necessarily the end of the question.
After a court has ruled
If a judge denied your petition, read the decision carefully to see whether it rested on standing, on the child's best interests, or on procedure. An appeal is possible from many final orders, but the time to file a notice of appeal is short, and an appeal reviews the record rather than hearing the case again. A new petition may be possible later if circumstances change meaningfully, such as a shift in the family situation or in the child's needs. Keep records of your past involvement with the grandchild, such as photos, cards, school or medical involvement, and messages with the parents. Avoid confrontations or contact the parents have refused, since those can be used against you.
Looking at the realistic path
Some families try mediation or a counseling-based approach before or after court, and a gradual return to contact sometimes lasts longer than an order would. When we meet with grandparents, we look at the relationship history, the reasons the parent gives, whether a custody or divorce case is pending, and where the matter has already been heard. We explain what a petition or an appeal would involve, without predicting how a judge will see it. We also talk through whether a different approach might serve the relationship better in the meantime.