The reason people go quiet around someone who is dying is fear of saying the wrong thing, so they say nothing, keep it cheerful, or stop visiting. That silence is its own loss. A dying person usually does not want a brave performance; they want your honest presence, ordinary conversation, and the chance to say and hear the things that matter. You do not need the perfect words. You need to show up and be real.
This is about talking to someone who is still conscious. For whether an unresponsive person can still hear you, see can a dying person hear you.