I don’t know where you are, so that’s a hard question to answer. If you are dying, I guess that means you have a terminal medical condition so here are a few thoughts. I hope they help.
Hospitals generally have social workers, so perhaps you can contact one at the hospital that’s been treating you. If you live in a country with free healthcare (like Australia), perhaps you could go to the hospital and be admitted for a few days to get you off the streets and into a bed while the social workers come up with a plan to find you accommodation.
I also think you should approach the ‘association’ for whatever your medical condition is, and see if they have counselors who could advise you about any support services.
There are phone services like ‘Lifeline’ or the equivalent in your country that might be able to point you in the direction of help.
And have you reached out to family members and longtime friends? You might be surprised at how willing someone you used to be close to is to open their door and welcome you in.
This is not the time to let pride get in the way. Reach out and tell those who care about you that you need help. If they can’t take you in themselves, they should be able to help you work the phone to find help.
I’m hoping you’ll receive the care you need.