How do terminally ill people know when they’re on their way out?

So being terminally diagnosed isn’t easy. You know you’re about to die and there’s nothing you can do about it. Everyone’s had to deal with a friend or family member being terminally ill at least once in their life. But the question is at what point do these people know when they’re finally on their way out
How do terminally ill people know when they’re on their way out?
Post Opinion