Instead of paying for hotel rooms join a health club so you can shower there, a one month membership in a health club is cheaper than one night in a shitty motel most of the time. Once the issue of showering is out of the way you can snoop around for a place to sleep.
If you don’t have a car then you’ve got fewer options. A guy here in Boston realized the only way he was going to get his college loans paid off was to stop paying rent, so he found a hidden place in a local park, set up a tent every night, and successfully lived that way for most of a year (spring to autumn.) From my own urban exploring I’ve noticed that any piece of no-man’s land in the city (abandoned buildings, overgrown vacant lots) ends up being a crash pad for the homeless and/or drug addicts, so you have to find a spot they won’t frequent. I have entertained the idea of sleeping in a tree using a camping hammock, but climbing a tree and trying to set up a tent in the dark is probably not wise. Ask a friend about using their backyard in exchange for yard work.
I have heard of people renting storage lockers and staying in them for a few months before management gets wise and kicks them out, but it would depend on the set-up/security. You can sometimes find office and industrial space where there’s one room available they have trouble renting to a business-- no amenities, and not zoned for residential so they wont let you live there, but if you can get in and out during the night they won’t know. Peeing in juice bottles and pooping in a 5-gallon bucket (with a top) is gross, but one way to get around not having a bathroom.
It’s all about saving money. Find a food bank or consider freeganism. I have survived for a week on road trips only eating from the ‘value menu’ at Wendy’s, typically baked potatoes for lunch and dinner (they used to $1 but the price has gone up.) A hot dog and a soda at IKEA is only $1.75, I’ve also gone in search of places where they are giving out free samples at the mall, walked back and forth eating from them all multiple times. In my most dire times I ate nothing but generic mac-n-cheese, ramen, and hot dogs, with maybe some frozen vegetables to spice all three up (and get vitamins.) Consider a camp stove too.