Designing functional mechanical objects like this requires the right tools. My go-to CAD software is Autodesk Fusion 360, which has an intuitive interface that allows you to create objects like this in no time. Get it here! (affiliate links)
These are usually called combination locks, but the numbers you have to enter are really a permutation–the order of the numbers DOES matter! Use this to lock yourself in quarantine and stop the coronavirus in its tracks...posted in April 2020 :(
To create your own customized permutation/combination lock, first choose a size (3, 4, or 5 numbers) and the actual permutation you want to use (e.g. for a 3-lock, 2-7-4).
From the files, slice print the top and bottom of the size you chose and the wheels for the numbers you want. Fit the wheels into the slots, place the two halves onto each other, and attach with either a M3x20 nut and bolt or superglue (make sure not to get any glue on the wheels–you won't be able to spin them if you do!). Both a bolt and glue would make the strongest lock. Keep in mind that it's made of plastic: it probably isn't sufficient to protect anything really valuable, though if you use PETG or another strong plastic it would be pretty difficult to break.
That's it! Make as many as you'd like in a variety of sizes. Please share feedback or results, and feel free to tip me if you like my designs!