I struggled a lot about writing accents and special characters in macOS with an Italian keyboard. The most comfortable way to do them is to hold option + press a key.
Specifically, for tilde, as mention above is Option + 5 (try other keys also, you'll be used to it in a while).
There 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 ô