In English we toss around phrases like nowhere to go, where from?, where to? In Portuguese it's a little different. For the most part, onde does all the heavy lifting. However, it's important to use it with the right prepositions and verbs to get the meaning you want.
Onde in Portuguese is used in several different ways. Often creatively, sometimes confusing.
ONDE in context
*Notice how using por & para are virtually the same thing. The para simply adds the idea of where to.
These last few examples are also good for understanding the differences between, SER, ESTAR & IR. These 3 verbs are always closely related.
I think this is the strangest one, for sure. But it's lots of fun to use. You can say things like, Se eu tivesse onde ir eu iria agora! (If I were to have somewhere to go I'd go there now!) & Sem onde ir ela dormiu na rua. (Without anywhere to go she slept in the street.)
When you convert sentences into their literal translation in English, it somehow makes it easier to understand as well as remember!
The correct position of ONDE
You can easily flip ONDE to the beginning or to the end of the sentence without changing the meaning!