I'm "lucky" in the sense that we got allemansrätten in Sweden so I can probably survive for a while by hiking in the forest with my shitty, heavy tent (got good shoes and a great backpack atleast, and a LifeStraw)
This is the safest thing to do. Bring something that will repel animals if they are an issue in the area. Peppermint oil for rats, pepper spray is fine for larger animals. Make noise when walking.
If the weather is bad (summer rains) there are some places you can sleep like bus/train stations (not in big cities though) If there is security then don't lay down but sleep sitting with your head down instead and tie your stuff to yourself firmly. Use sunglasses to hide that you're sleeping.
What worries me the most now is other people. I don't give a fuck about the law, I will carry my knife and pepper spray openly even if it's illegal here.
I'm not sure if you have visitation zones in Sweden like you do in Germany and Denmark. If you do then don't walk there because police will search all your belongings.
In small towns and rural areas you can generally trust people. In cities avoid homeless shelters and places known for having lots of homeless people unless you're a drug addict and need to score, in which case don't walk in there alone.
Avoid city centers on Friday/Saturday nights because that's when drunk Arabs walk around in groups harassing people.
I was homeless because I was a teenage runaway without papers and couldn't legally rent. At the time I felt like I only had one option... And I made enough money daily to have a warm bed and good food. I was comfortable, but the things I was made to do will haunt me all my life. Remember that you can always sell your soul but you will never be able to buy it back later.
The most dangerous people you will meet will never be the ones who try to attack or hurt you in other ways. They will promise you shelter, money, free drugs and make you dependent on them.
If you can get gibs from the government (you should be able to in Scandinavia), take them. Don't spend them on hotels as tempting as it seems but collect them and wait until you can pay off the deposit for an apartment. If you do everything right you can be back on your feet in 3 months.