How do I use my external keyboard for typing in a foreign language?

Go to System Preferences and to Keyboard. When that pane comes up, select the Input Sources tab. This is where you choose a foreign keyboard. See figure below.

enter image description here

You can see in the figure what the keyboard looks like for the Russian language. By clicking the 'Show Input menu in menu bar' you'll have a menu item to view the foreign keyboard whenever you want.