First keep recipe the same (amount of ground coffee in and amount of extracted coffee out) and tweak grind size to get brew time in the right range (25-30 seconds)
When numbers are in the right range use taste to tweak extraction: sourness is mostly under-extraction, bitterness is over-extraction.
Lighter roasts: more work to extract the coffee, which means use less dose or coarser grind. If you start with a big dose, impossible amount of work to do. Sour, weak body as a result. Here underextraction can thus be because of too fine grinds as well!
Darker roast: easy to extract, soluble get out quickly, is OK to use a higher dose. Can benefit from finer grind.
Instead of changing grind size you can also tweak dose a bit, add more dose: is more work to extract, slower flow, so longer contact time.
You can increase extraction with lower dose, also maybe combined with finer grind
Brew time: 25-30 seconds is a good target, but not so important.
You can also increase brew time for an extra little bit extraction, you trade this for strength (because you dilute), but can add clarity and sweetness
Grams out is very important to monitor, to keep the ratio the same.
Espresso ratio: 1.5-2.5, meaning ratio between grams coffee in and grams of liquid out.