Put beans in a big bowl and generously cover with water. Add a splash of apple cider vinegar or two teaspoons of baking soda. (This will help remove phytic acid from the beans and also will help make them more digestible and create less of a gassy side effect.) Let them soak for 24 hours. Pick out any floating beans and throw them away. (Soaking is good for digestion but not necessary for cooking)
Rinse beans well.
Put the beans in the crockpot or instant pot with new clean water. Remove any floating beans.
Add the onion, garlic, and seasonings.
For crockpot, cook on high for 4 hours, then on low for 2 hours. For instant pot, cook for 35-40 minutes, manual high pressure, then NPR.
If you want them mashed/refried, take a potato masher and go to town.