If you want to create the case that an algorithm solves, perform the algorithm from back to front but doing the opposite of what the move says. Easy example for the algorithm: R U R'
To set up this case you would look at the end of the algorithm (in this case R' is last) and perform the opposite of what it says so you would do R, overall, to set up the case applying this method the set up algorithm would be: R U' R'
Hopefully that made sense.
It might be easier to see with a slightly longer alg, so for a random example:
This is the "solution" alg: U' R U2 R' U2 R U' R'
And this would be the "set up" alg: R U R' U2 R U2 R' U
notice the set up is the solution alg performed backwards and opposite (_2 moves are done the same, as 180 degrees either way is the same).