ideally, you match them with a tone generator and a scope, but many gain knobs are labeled so you know pretty much where to set the gain if you know the head unit's preout voltage. usually you set the gain a little higher than the preout voltage, since that voltage is at full volume and most people don't go full vol. that way at say 3/4 of full, you'll be at ideal level on the amplifier input.