Washing ore is probably the easiest solution - research high levels of mining productivity, put quality modules in drills, filter off uncommon+, and loop them through recyclers until they are at the desired quality level.

It’s inefficient but has a very low cognitive load.

You can improve the efficiency a little by increasing the quality floor each level, eg rare iron ore, epic iron plate, legendary steel. But in my post endgame playthrough I was drowning in so much legendary ore with this method I didn’t bother.