Rinse dry beans carefully. Remove any debris. Put all ingredients into a large pot (or slow cooker or Instant Pot!). Cook on medium heat for 4-5 hours or until beans are tender. Add more water, if necessary. If using an Instant Pot, these beans cook in 35-40 minutes. It's miraculous!
To make a quick version of refried beans, remove most of the water and purée beans, garlic, and onion with an immersion blender.
For traditional refried beans, heat oil or lard in a large frying pan. Strain beans and add to hot oil. Allow to simmer, then mash with a handheld potato masher or similar tool.
Variations: Add ham hocks or bacon. If you are in a hurry, use garlic and onion powder!
Tip: Salt the water very heavily! The beans will come out very flavorful as a result. Drain the majority of the water before serving or puréeing.