It depends on the engine - I believe each engine would have ways of making localization possible. But the fundamental principle is that you have a file of all the strings (dialogues, menu options, etc.) for each language, and the localization library retrieves the text for a given key from the respective locale file. Wherever you use a string, you replace it with the key; for example:
If the start button normally says "Start", then you create a key in e.g. the file en.json called "start", "menu.start" or some other unique identifier:
{
"menu.start": "Start",
}
and then where the text appears, you replace it with a call to the localization library's respective function. I'm gonna use a hypothetical Flash example since I don't know what it's like in Game Maker:
//old
startMenu.text = "Start"
//new
CURRENT_LOCALE = "en-US"
startMenu.text = getLocaleString("menu.start", CURRENT_LOCALE) //e.g. en-US="Start", fr-FR="Jouer", etc
where you present the option for the user to select a different locale (e.g. fr-CA) or retrieve the value from their operating system's language. The neat part is that the locale library should allow you to fall back on languages provided you don't have the exact locale - for example, fr-FR can be the default for french, so that if the user's language is fr-CA then it'll still display it in french rather than going haywire.