If a traveller - for whatever reason, is arrested on charges (valid or otherwise), what steps should he/she take to ensure their safety, local and home legal aid and security? How can one make sure your family and country knows about the situation? What if you don't understand the language, or what the charges are?
The level of support offered by embassies will vary widely from each foreign embassy / consulate to another. A couple of standard support measures provided though are:
Probably more important than what they do provide is what they don't provide. Embassies do not directly provide legal assistance, immunity, or evacuation just because someone is in trouble with the police. If caught in such a situation, it's necessary to manage expectations on what an embassy can do realistically.
While it isn't always possible to know the local laws of a country, not knowing you did something wrong is rarely ever a valid excuse. Use common sense - and as a rough yardstick don't do anything illegal in your own country - for starters. This is especially problematic if you're travelling in regions police officials are known to be corrupt as they could use legitimate less-known laws or made-up charges to shake you down. Embassies will rarely, if ever, provide assistance in these situations unless something seriously goes wrong.
Another thing that can help you receive assistance quickly is your country's embassy offers any form of registration programme, so that they know your details. Probably not very useful or even necessary for short-term travellers though.
During the Cold War (and probably continuing to this day), Russian spies were taught to say, "Call the the Soviet Consulate," or "Call the Soviet Embassy," when caught. While undergoing training, they were tortured to induce them to say more than that. If they said "more," they flunked the course, were kicked out of the program (and lost their main chance to travel abroad). Instead, they were supposed to go on and on with the one theme like a broken record.
That's a bit melodramatic, but that's the basic idea. A prisoner of war is not supposed to give out more than his name, rank, and serial number. Under the circumstances, you are a "prisoner," and not of war. Just state your citizenship, particularly if American, Chinese, Russian, or that of any other superpower, and call for the "cavalry" (your embassy or consulate). Try not to say anything else, your name, local address, or ever admit that you were at such and such a place at such and such a time. The one exception is a if a "policeman" stops you, and says, "pay a small fine, and I'll let you go."
Your consulate/embassy can't "spring" you from captivity. It can, however, make sure that you have access to (local) legal representation, and are treated "fairly" in accordance with the laws of the country and the facts of the case. It will also set up a line of communication with your family and friends at home.
The arrest, trial, conviction, and recent release of American Amanda Knox in Italy illustrates the importance of following these rules. She almost got herself "put away" for 26 years, making (admittedly coerced) "confessions."