Open your System Preferences and click the International icon. In the dialog, check for Spanish (and other languages you want to have the keyboard layout for).
Under the list you will see which keyboard shortcuts to use when you want to change between the different input languages. The shortcut is editable by pressing the button in the same area.
In the bottom of the dialog you can check for showing the keyboard menu in the menu bar on top of the screen. I find this very convenient.
OSX also allow, and remember, different input languages in different applications.