1. Get a sheet of paper.
2. List down all the positions of cubies that you care about and aren't fixed, be they edges, corners, (for big cubes / other puzzles) centres, whatever. (E.g. for VLS, you
don't include the two pieces that form the last F2L pair even though they aren't solved. These two pieces are constant across all the different VLS cases.)
3. Write down literally every possible cubie that can be in the first position.
4. If it fits on the same sheet of paper, for each of the possibilities thus far enumerated, write down every possible cubie that can be in the second position. If not, get more paper.
5. Repeat with the third, fourth, etc. positions until you're done.
6. Now get yet another sheet of paper (or possibly many more sheets of paper) and group cases together into equivalence classes, if necessary. E.g. for PLL, you don't quite care if your N perm has aligned blocks at FR/BL, at FL/BR, or if it has no aligned blocks at all.
(Optionally, replace "paper" with any electronic version if you don't like killing trees.)
If this seems like a lot of work, you can shortcut steps 3-5 with some combinatorics knowledge. (You should quickly start seeing some patterns as you work this out; try to convince yourself of the
multiplication principle. But also watch out for parity, and if relevant (e.g. RU 2-gen), other constraints.) Step 6 can be "shortcut" with group theory but it's usually not too onerous to just brute-force your way through it. You can also rearrange/split step 6 to be anywhere else in the list to make your life easier, e.g. listing ZBLL by first enumerating CLL, grouping them by AUF equivalence, then enumerating the possible edge permutations, then grouping together by equivalent cases again (for the few symmetric CLL cases).