In reply to James Malloch:
IME there can be various reason for new cut keys not to work well. Are the new keys identical to old in all aspects, including where the stop collar (or equivalent) is? Key length, shape, a stuck lever, etc, all can have an effect particularly if you have cut keys based on a well used key and well used lock.
Removal - depends on the type of lock; some remove as you describe, others you can remove the lock barrel alone.
What I personally diy would do is take the lock out and try new keys in removed lock/barrel to see if that works or not. Then, “if”* it is one where the side plate can be unscrewed, open it up (keep it flat so nothing inside can move or fall out and be very careful not to dislodge or let anything anything shift when you have a look!). It is usually a very easy procedure. However, word of caution, if you are new to this suggest you take multiple photos/video of all stages as it’s very easy to convince yourself what went where at a later time!
* If as many can’t now be opened easily or have a separate lock barrel (mine do) and this can’t be opened/examined, but can probably be cleaned and lubricated.
Depending on what you see, it may be just badly worn, needing a clean, etc. Often you can insert the new key from the underside when it’s open and try it and see where it is failing (again care is needed not to dislodge levers etc, and some locks you just can’t do that on due to design).
The easiest alternative is to buy a new lock. This may be a full lock or could be just a barrel replacement (similar but different to Yale locks) depending on lock type. Just make sure it is identical in all aspects as regards to sizing to that you remove. If it doesn’t measure precisely the same, it may either not fit/work at all or may need some alteration to the door if this is possible.
Also, as a thought, if you are replacing the lock best check that it meets modern insurance requirements; generally as I’ve seen lately insurance requires min of 5 lever locks/ high security locks/etc, for cover for break in yet you can still buy basic 2/3 lever locks which would not cover any break ins.