First, heat the olive oil in a medium skillet over medium heat. Add the finely chopped onion and cook until it becomes soft and translucent, which should take about 5 minutes. Then, add the minced garlic and continue to cook for another minute until it's fragrant. This step builds the foundational flavor of your dip.
Next, stir in the ground cumin, chili powder, smoked paprika, cayenne pepper, salt, and pepper. Cook for about one minute, stirring constantly. Toasting the spices before adding the other ingredients helps to awaken their essential oils and deepens their flavor, making your dip much more aromatic and tasty.
Now it's time for the star of the show. Add the drained and rinsed black beans to the skillet, stirring to coat them in the spice mixture. Use a potato masher or the back of a large spoon to gently mash about half of the beans. This creates a wonderful texture that is part creamy and part chunky.
Remove the skillet from the heat. Stir in the fresh lime juice and chopped cilantro. If you're aiming for a creamier consistency, mix in the sour cream or Greek yogurt now. Taste the dip and adjust the salt, pepper, or lime juice as needed to get the flavor just right for your palate.
Transfer the finished black bean dip into a serving bowl. If you're a cheese lover, sprinkle the shredded cheddar cheese over the top. You can serve it immediately while it's warm, or let the cheese melt under a broiler for a minute or two for a bubbly, golden-brown topping.