Basically, for each element from left to right, you generate all the permutations of the remaining elements. You can do this recursively, (or iteratively if you like pain) until you get to the last element at which point there is only one possible order.
So, given a list: [1,2,3,4]
You just generate all permutations that start with 1, then all the permutations that start with 2, then with 3 and 4.
This effectively reduces the problem from one of finding permutations of a list of four elements to a list of three elements. Once you continue reducing to 2 and then 1 element, you have all of them.