Heat the butter or oil in a large frying pan over medium heat.
Add the onions and cook for a few minutes until soft and translucent.
Turn the heat down slightly, add the garlic and season with salt and pepper. Cook for another 30 – 40 minutes until the onions are nicely caramelised. Transfer to a large bowl and allow to cool.
Add the sour cream and mayonnaise to the caramelised onion and mix until well combined. Place in the fridge for at least 2 hours to set.
Serve with pickled red onions, crackers, chips or crudites for dipping.