The US embassy will help you if your passport is lost or stolen. If you are living abroad and need to renew a passport, get a passport for a child born abroad, or obtain extra pages, you can.
However, visas are a purely local issue - the US Embassy is not going to insert itself into the immigration process of whatever country you are in.
Many travelers, and even Americans living abroad, have little understanding of the purpose of embassies. They aren’t there specifically to help American citizens - they exist to foster diplomatic relations, promote American goods and services abroad, and (in the case of developing nations) oversee the administration of aid through affiliated organisations like USAID (which was independent but is now under the US State Department). Only the consular services section, which is but a small fragment of the overall embassy, is there for the express purpose of serving the needs of individual American citizens.
Having said that, they will assist in certain extreme situations - they can help with facilitating the arrangements to repatriate the body of an American who has died abroad, for example. In the event of a death of an American abroad, they will do what they can to notify relatives back in the US. And I don’t know exactly what they will do if you’ve been arrested, but if I’m not mistaken they will provide contact information for local legal representation and facilitate communications between the jailed citizen and family back home.
They also allow traveling Americans/those residing abroad to register, which can be a useful service if there is unrest/a disaster/somewhat mundane variations thereof. As registered Americans living in Indonesia, we receive regular e-mail updates about anticipated demonstrations or unusually high risks due to volcanic eruptions and the like.
One thing I’ve always found peculiar is how little the Embassy assists in terms of helping Americans abroad to vote. For voter registration, absentee ballots, etc., you are generally better off working with either Democrats Abroad or Republicans Abroad.
Misapprehensions about what embassies can do for their citizens aren’t limited to Americans. I know a British guy here who constantly complains bitterly that the British Ambassador never invites him to embassy parties, just because he happens to be one of the no doubt thousands, if not tens of thousands, of UK citizens residing in Indonesia. But that isn’t realistic. Only where the foreign presence is very small does that make sense. We used to get invited to the Fourth of July celebration at the US Embassy in Mozambique for the simple reason that we were Americans living in Maputo. But that’s because there were so few of us that it was doable.