The Foreign Ministry is a Tier 2 government building in Civilization VI: Rise and Fall. It is built in the Government Plaza district and requires a Tier 2 government (Merchant Republic, Monarchy, or Theocracy) and a Tier 1 government building (Ancestral Hall, Audience Chamber, or Warlord's Throne).
Of all the Tier 2 government buildings, the Foreign Ministry has the most limited scope of use. The problem with city-states' armies is that they are very likely to be obsolete, and a mere +4 Combat Strength doesn't help bridge the power gap. If you want to levy them, you must pay Gold to levy and then extra Gold and resources to upgrade them. This only works for defensive civilizations that tend to amass a huge treasury and resource reservoir without a large standing army, and need to mobilize a large army in a short period of time when they are attacked. Other than that, the only two civilizations that should build this building instead of the Grand Master's Chapel or Intelligence Agency are Sumeria (who can already levy city-states at a discount) if they have a lot of resources, and most importantly, Hungary. Hungary has excellent synergy with this building, as they have no problem with upgrading units once they collect the Gold to levy them. The extra Combat Strength on top of the bonus from Matthias Corvinus is also greatly appreciated.
In Gathering Storm, the +3 Diplomatic Favor arguably becomes the best benefit of the Foreign Ministry, especially for those attempting a Diplomatic Victory. The equivalent of three Suzerainties' worth of Diplomatic Favor can be potent if this building is built early on, though doing so means forgoing the Intelligence Agency and its bonuses to Spies (which a diplomatic player wants for Fabricate Scandal missions).
Relations between civilizations and nations have long been defined by formality, as good manners help soothe misunderstandings and prevent wars from breaking out. This naturally leads to civilizations recruiting people to serve as diplomats, and for other civilizations to receive these diplomats, and as things get more and more complex, adding an entire class of people to the civic system who are responsible for engaging with the diplomats on behalf of the government.
The Foreign Ministry handles all matters of diplomats, ambassadors, credentialing, and recognition of other governments and their ministers. It is frequently viewed as one of, if not the most, important offices of the head of state, as it serves as the agency that represents the nation or civilization on the world stage. Ministers and Foreign Officers are usually rigorously tested and vetted, because the importance of good relations between peoples today is just as important as it was when Egypt and Babylon exchanged diplomatic greetings in antiquity.