On the side of the lock, you will see a small button. Use the end of a pen and push it in, set the lock to the numbers you want then push up on the lock release. The lock is now set.
It depends on the design. Most often there is a small lever inside. You push that when the code is set correctly, and then turn the dials while holding the lever. When you let go, the new code is set.
Luggage sets can be cheap or very expensive depending on the brand and the number of pieces. Usually you can get a good set for about 200.00 for 3 or 4 pieces.