Don’t know what to say to friend with cancer?

Hey everyone, this is going to sound like a very dumb and privileged post.

I just found out a friend of mine (we used to be close but haven’t spoken in years) has/had cancer. I found out through their Instagram story because they posted about their last chemo treatment.

I consider myself very lucky because none of my close friends and family have/had cancer, so I am VERY ignorant regarding that.

Would that mean they’re done with the treatment because they no longer have cancer? If that’s the case, is it appropriate to congratulate them? Or wish them luck?

I feel so ridiculous asking this but I don’t want to say the wrong thing. I know this is a very sensitive topic so I really do want to watch what I say. Thank you!