There is an international convention that foreign citizens have access to their embassy in any country if they are charged with a crime. One of the countries that violates this international agreement is the USA. However, if an American citizen is arrested in a foreign country, they go all out to save him

When I was in the Middle East, an American woman's dead body was found in her bath tub. She had been strangled to death. Her husband was charged with the murder (he had also tried to dissolve the body in acid, so the recovered body was disfigured). He claimed that he had been framed by the local police. The US Embassy got him released and sent back home. If he had done the same thing in the US, he was looking at the lethal injection.