How can you allow an unregistered user to change languages? I have no clue to which is the Drupal way of allowing any user (registered or not) to change the website language.

The way I need it to work is to allow any user to click on their preferred language flag and just change the interface language.

What modules should I look into?
Is there any function I should be calling when clicking the flag?

Any link to something resembling a walktrough is also appreciated.
If it's just the interface you'd like to translate, then I think you can get by with Locale (a core module). If you want content translation (and many other things) you can use i18n. The project page for i18n gives you plenty of links to follow for other projects and documentation.