Depending on culture and the people, just going might be uncomfortable for the people you want to support. Maybe your friend was close with the deceased and thus their family would like them to be there, but not a stranger. Additionally, your friend or the family of the deceased may feel obligated to interact with you and make you feel welcome because you went. Maybe they’d prefer if you hadn’t gone.

I’d instead recommend asking your friend (though again, this advice may be culturally dependent). Be sure they know it’s about you supporting them.

I remember when a family member died and only one classmate asked me if I wanted them to come to the funeral. I refused but remember the gesture to this day. It’s about the only thing I remember about the person. I also remember a couple of other friends to whom I was closer not asking me, and that stuck with me because they both disliked and badmouthed (I don’t really know why, I avoided dumb drama) the original person. That made me rethink a lot of things.

Anyway, I guess the point is to think of what your friend would like and make sure they understand you’re there for them.