Often, I'll have a need to create a voltage divider that has a specific resistance ratio, to obtain whatever voltage I need on the output. For example, for a specific project I'm working on (creating a reference voltage for a buck regulator), I need a resistance ratio (R1 / R2) of (nearly) exactly .375. This is an easy example, as a 3k and an 8k would work just fine for this - but often there isn't an obvious common-valued resistor combination to create whatever ratio you need. Since resistors are only made in discrete values, I'm curious of the best way to go about choosing what feels like a near-arbitrary selection of resistors. I'm thinking about cases when you want maybe <2% error (for voltage references for example), so just picking 2 close resistors probably wouldn't be super easy.
Resistor series values are designed such that you can select for ratios with an accuracy on par with the tolerance. For example, the E96 series (https://en.wikipedia.org/wiki/Preferred_number) is used for 1% resistors. Pick two values from the table and calculate the divider ratio. If you switch one of them out for an adjacent value in the table, the difference in the ratio will be less than 1%. This works for any resistor series. If you need to do better than that, you can use a trimmer, expensive laser-trimmed resistor arrays, or possibly some form of calibration to compensate for an offset divider value. If you really need high precision, don't forget about the temperature coefficients.