Let’s suppose that you’re going to track a bond index, and you want to match average maturity, average (effective) duration, average (effective) convexity, and average credit rating. You have four factors, so you need four bonds in your tracking portfolio. The average maturity of your tracking portfolio will be the weighted average of the maturities of the four bonds you’ve chosen; similarly for average duration, average convexity, and average credit rating. Thus, you have four (linear) equations – one for each constraint – in four unknowns – the weights on each bond in your tracking portfolio – and you solve those four equations using standard linear algebra techniques.
At least, that’s what the CFA curriculum says.