Recovering critical and other raw materials from landfills and mining waste