In 2017 Nintendo sold roughly $257 of Switch hardware for $300. 40 dollar profit. They might have increased the margin since then.
A $60 game is sold to a retailer for $38-45. The publisher takes 20 of that (nintendo in this case) and the advertising & developer take the remaining 20. So nintendo probably takes 40 dollars profit from first party games like Zelda.
Margins on consoles used to be lower, $10-20 and they'd make $40 on the controller sales. The joycons on the switch cost 45 to make and sold for 50. The margin is back into the console as a whole again.
Digital sales on ingame items are likely close to pure profit.