Navigating Personal Struggles in Casual Conversations

I’m curious, when a friend unexpectedly shares something heavy during a light chat, what’s a good way to respond? I want to be supportive without making things awkward or overstepping.