I have traveled a lot by myself. In experience, if you look confident and look like you know where you are going (even if you don't
), you are less likely to be bothered by folks looking to take advantage of a traveler.
I always maintain an awareness of who is around and behind me, especially if a stranger tries to engage me in conversation. They look for folks who might seem unaware and/or are easily distracted. For example, if I enter a train car, I will scan everyone in the car, and passengers coming on, to determine who is there, and to let others know who are looking at me that I am aware that they are there.
When traveling somewhere for the first time, I do a lot of research - e.g. what you have to go through getting from the plane gate thru (if international) customs to and checked luggage and then ground transportation. Where are the safe taxis (or sometimes spend extra for a private taxi). The location of the hotel, reviews (which I do take with a grain of salt, the more detailed ones are the better) and what is around it in the neighborhood. What the popular local scams are (you can find a lot of visual examples on places like YouTube). How to dress so that it is not obvious that you are a tourist with money. I lean enough of the local language to say "hello" and "no thank you". And so forth.
I will not eat in a restaurant that does not have posted prices, and I try to sit near the front. And, given the situations that have occurred in the news, I have decided to drink only water, and *never* alcoholic drinks when traveling. On those rare occasions when I feel like imbibing, I will buy something in a store and sip it in my hotel room.
Going back to strangers starting conversations, I stay wary and do not give out information about myself beyond general stuff. I also take an attitude of "do not trust someone offering you are bargain" - whether it be a cheaper taxi ride, restaurant, non-official transportation, etc. And as soon as the conversations starts going where I do not want it to go, I politely break it off.
Finally, as a guy, I watch out for unknown attractive females approaching me. I assume they are trying to distract me for some purpose (like a pickpocket), or lead me somewhere were something even more nefarious could happen.