Annual pruning keeps lavender neater and more compact. This can be accomplished by shearing or by pruning individual stems.
In areas with colder winters like we have in the Shenandoah Valley, do this pruning in the early spring.
In areas with milder winters, they can be pruned right after they finish flowering.
Prune to remove the old flower stems, removing at least one inch of the leafy growth below the spent flowers.
Old, neglected, overgrown lavender plants cannot usually be rejuvenated by more severe pruning; they should be replaced with young vigorous plants. This may be the best course of action if they have been in the ground for many years. You can try pruning them in the spring to see how they respond. If they don't flush out with nice new growth, consider replacing them.