This recipe is from Hugo Ortega’s Street Food of Mexico cookbook. Find several more recipes from the book here.

For the refritos (refried beans)

2 cups dry black beans, well rinsed and
   picked over

½ small white onion, quartered,
   plus another whole onion, finely
   chopped

1 ¾ teaspoons kosher salt
&frac13 cup olive oil or lard

Place a medium heavy-bottomed pot over medium heat. Add beans, the quartered onion, salt, and 4 cups water and bring to a boil, about 5 to 7 minutes. Lower heat and simmer beans until soft, about 1 hour and 30 minutes. Strain and discard liquid. Transfer beans to a blender and purée until smooth.

Place a cast-iron skillet over medium heat, add oil or lard, and preheat 2 minutes. Add the chopped onion and cook until translucent, about 3 minutes. Add bean purée and lower heat. Simmer for 15 minutes, stirring occasionally to prevent sticking. Remove from heat. Makes 3–4 cups. (You will have extra beans.)

For the salsa

8 tomatoes, roasted
½ cup finely chopped white onion
3 serrano peppers, stemmed
1 cup fresh epazote leaves, loosely packed
  (available at many H-E-B and Fiesta supermarkets)
½ cup olive oil
1 ½ teaspoons kosher salt

Place tomatoes, onion, peppers, and epazote in a blender and purée until smooth. (Can make a day ahead up to this point. Cover and refrigerate until ready to use.) Place cast-iron skillet over medium heat, add oil, and preheat 2 minutes. Cook the salsa for 2 minutes, stirring constantly. Lower heat and simmer until reduced by a third, about 10 minutes. Add salt. Makes 3 cups.

For the tlacoyos

1 pound masa (available at many H-E-B and Fiesta supermarkets; buy premade
  —ask for masa for tortillas, not tamales—or use a mix)

½ cup refritos
1 tablespoon corn oil
8 flores de calabaza (squash blossoms),
   washed, stemmed (available canned if you can’t find fresh)
½ avocado, pitted, peeled, cubed
2 tablespoons queso fresco, crumbled

Divide masa into 8 equal balls; cover with a moistened kitchen towel while working. Using the palm of your hand, flatten each masa ball into a patty, about 4 inches in diameter and ¼ inch thick. Place 1 tablespoon refritos in the center and enclose the beans inside each patty by rolling it into a cylinder. Gently press each cylinder into an oval shape, about ¼ inch thick. (If making ahead, place the raw tlacoyos on a sheet pan lined with a piece of parchment paper; cover with another piece of parchment paper and plastic wrap. Store in the refrigerator up to a day.)

To assemble

Place a heavy-bottomed skillet or comal over low heat and preheat 5 minutes. Drizzle with oil and wipe off excess with a paper towel. Working 2 at a time, place each tlacoyo on the hot comal and cook 3 to 5 minutes on each side. Remove from the comal and top each with 1 squash blossom, ¼ cup salsa, and 1 tablespoon cubed avocado. Sprinkle 1 ½ teaspoons queso fresco on each.