Here's how to cook onions for burgers: 1. Chop onion into thin slices, or grate it using the large holes on a cheese grater. 2. Heat up a frying pan on medium-low heat and add some oil, either olive oil or vegetable oil. 3. Add your onions to the pan and stir them around until they start to soften about 5 minutes. 4. Add salt and pepper to taste if desired, then remove from heat and set aside until ready to use in burgers!