This depends entirely on which country you are asking about, but the underlying advice is the same everywhere: find out early whether the country has one dominant language or several, because that shapes everything from paperwork to friendships.
Many countries are far more multilingual than outsiders expect. India, Switzerland, South Africa, and Nigeria all have multiple official or widely used languages, and the language of government may not be the language of the street. Even in officially monolingual countries, regional dialects can differ enough that what you learn in a textbook sounds odd locally. Spoken Arabic varieties, for instance, differ significantly from the standard written form.
Practically, check the official language used for contracts, banking, and immigration paperwork, since that is what you will sign documents in. Then learn greetings and courtesy phrases in whatever people actually speak in your neighbourhood. Locals almost everywhere warm up noticeably when a foreigner makes even a small effort with the local tongue.