I've found success in using simple and clear language with my toddler to help manage expectations - explaining what's happening, why it's happening, and what's expected of them, in a very straightforward way seems to help them process and accept what's going on, especially when we're out and about or dealing with transitions.
Also keeping my explanations short, direct, and engaging has helped too - for instance: "We're getting the train now, it's a big one that goes zoom! We'll buy some yummy snacks once we're down at the station!" It helps to make things sound exciting, and gives them something else to focus on.
Using reverse psychology can also be pretty effective sometimes - telling my toddler we aren't doing something they actually want to do (like going to the park) usually backfires because they'll often get upset or become extra determined; so instead I'll say something like: "Oh no, the park is closed today! We better not go there..." and often they just accept it and move on.
Another trick is bribery... ahem, I mean incentivising good behaviour with treats or little rewards! This can be as simple as a special sticker or their favourite snack food to keep them focused and well behaved when out running errands; it's amazing what a lollipop can do!