IF USING A PRESSURE COOKER:
Combine beans, water, green onions, garlic, 1 tablespoon olive oil, and 2 teaspoons salt in the pressure cooker and seal the lid. Cook on high pressure for 30 minutes. Let the pressure release naturally; don’t open the pot until it’s cool. The beans should be very soft. Discard the garlic and the green onions; set beans aside but don’t discard the bean broth.
IF COOKING ON THE STOVETOP:
In a large pot over high heat, combine beans, water, green onions, garlic, 1 tablespoon olive oil, and 2 teaspoons salt. Bring to a boil and cook for 10 minutes; reduce heat to medium-low; cover and simmer until the beans are tender, 1 to 2 hours. Uncover the pot and let cool.
In a large skillet over medium heat, warm the ½ cup olive oil. Add the onion and sauté until it turns light golden brown. Don’t let it get too dark, or it will become bitter. Add the beans and their broth and continue cooking until the flavors come together, about 15 minutes. Add about half of the tomato sauce and the corn. Cook for another few minutes to combine the flavors. Add more tomato sauce if desired. Season to taste with more salt, if needed.
Serve with chopped cilantro and avocado, if desired.
