When to say sorry

Hey guys,

My friend had a death in the family yesterday and I absentmindedly asked how the relative passed too early.

Understandably so they never wrote me back. Should I follow up and apologize?

I don’t know when the best time is and I don’t want to make matters worse

Should I wait a couple of days to say sorry?