I found about 1 onion is good for one sandwich, so if you’re making two sandwiches, use two onions, etc. You can cook them slowly for about 45 minutes to caramelize them or if you’re in a hurry, just sauté them until golden brown and soft. If you’re cooking several onions, use more butter, enough so they don’t stick.
Take your cheese out of the refrigerator before you start. It will melt and cook evenly if it’s room temperature. I used a combination of sliced swiss cheese and grated gruyere (feel free to use more than 2 pieces if you want. I like lots of cheese!).