What's the cheapest and best way to travel Europe?

I want to eventually travel all over the place. But I’m not sure if I’ll have the money to be staying in expensive hotels in the hearts of major European cities, but I also want to be safe and not end up dead. What is the cheapest, safest, and best way to take a tour of Europe. (or even just a single European country)
Do you have to have a lot of money in general in order to travel to foreign countries? Or is that just a myth?

How much would it cost to travel Europe for a month or two?

New summer i want to travel around europe. Visiting mainly germany, france, England, and Spain.
If i dont stay is really nice hotels and i don’t really do a lot of just shopping, how much do you think it might cost?
like how much for a month?
oh and any good tips?