I struggled a lot about writing accents and special characters in MacOSXmacOS with an italianItalian keyboard. The most comfortable way to do them is to hold option+option + press a key.
Specifically, for tilde, as mention above is option+5Option + 5 (try other keys also, you'll be used to it in a while).
thereThere are other special combinations for accents which are option+n and a letter for ñ option+u and a letter for ü option+8 and a letter for ú option+9 and a letter for ù option+ì and a letter for ô:
- option + N and a letter for ñ
- option + U and a letter for ü
- option + 8 and a letter for ú
- option + 9 and a letter for ù
- option + ì and a letter for ô