Fresh tortilla masa is best for making tlacoyos, but masa harina is a good substitute. Look for both, as well as cactus paddles, at Mexican grocery stores.
Peel and quarter onion. Finely chop three-quarters of it and set aside.
Heat oil in a medium skillet over medium heat. Add the remaining onion wedge and garlic. Cook, turning often, until blistered and golden brown in spots, about 5 minutes. Remove the onion and garlic and discard.
Add beans, 1/4 cup water and 1/4 teaspoon salt. Coarsely mash the beans with a potato masher, adding more water by the tablespoon until half the beans are smooth. Set aside.
If using fresh cactus, cook in a saucepan of boiling water until tender, 3 to 5 minutes. Drain and rinse well with cold water. Set aside.
Combine masa harina and the remaining 1/2 teaspoon salt in a large bowl. Add 1 cup -water and knead together until combined, then add 1/4 cup more water. Knead for 5 minutes, adding up to 1/4 cup more water, to form a very soft, moist dough. To test if it's moist enough, break off a piece, roll it into a ball and flatten it. If the edges crack, add more water and knead until combined. (If using fresh masa: Place in a large bowl and sprinkle with a few tablespoons water. Knead firmly, adding a little water if necessary, until very soft and creamy.)
Divide the dough into 8 portions, about 1/4 cup each, and cover with a damp cloth. Roll one piece of dough into a ball. Place between 2 sheets of plastic wrap and roll into a 5-inch circle with a rolling pin or very lightly press with a plastic wrap–lined tortilla press.
Remove the top layer of plastic and spread 1 1/2 tablespoons of the beans down the center of the dough. Using the sheet of plastic to help, fold both sides of the dough toward the center to enclose the filling. Pinch the seam closed. Place between sheets of plastic or return to the lined tortilla press. Roll or flatten into a 1/4-inch-thick oval patty. Repeat with the remaining dough and beans. (See photos on page 104.)
Heat a large skillet or griddle over medium-high heat. When hot, reduce heat to -medium and cook 2 tlacoyos at a time until the sides look slightly dry, 2 to 4 minutes. Flip and cook until the second side is golden brown, 2 to 4 minutes more, adjusting the heat as necessary. Wrap tightly in foil to keep warm.
Serve the tlacoyos warm, topped with the reserved onion and cactus (or pickled cactus), cheese, cilantro and salsa.
Equipment: Rolling pin or tortilla press