On some keyboards (e.g. those on phones and tablets) you can touch and hold a letter and it will show options for that character.
Otherwise you may need to set your keyboard up to be able to type using macrons. Below are a couple of links to websites that have instructions on how to do setup and then type using macrons.