The following keyboard command should create a tilde ~
on a Scandinavian (Danish, Swedish, Norwegian, Finish, Icelandic) Mac keyboard on your Mac computer:
Alt + ^
If you need help for other countries and regions, check out this Stackexchange thread.