Easier said than done if doing what I have want is only hiring office workers, then suddenly the wfh people aren't happy.
They want both the specific job and the ability to work from home.
There is a zero sum element to it.
The best solution is for workplaces to be up front and consistent in their policies and let people select in or out.