The city of Hamburg supports you in your search for suitable living space with open-ended rental contracts. Since this is often difficult and takes time, there is also the option of renting short-term apartments for a few months or a few years.
You can use the hotline "Quick help for vulnerable homeless people in Hamburg" to report if you see a homeless person on the street who is helpless or in an emergency situation.