Yield curves are borrower-specific, so different curves are constructed for sovereign debt (e.g., the US Treasury default-free curve), the interbank markets (the swap curve), and corporate debt (a credit spread over the swap curve).
They are typically constructed and calibrated to the market prices of a variety of fixed-income instruments, including government debt, money market rates, short-term interest rate futures, and interest rate swaps. To build a smooth and consistent curve, you use a combination of bootstrapping, curve fitting, and interpolation techniques. These curves, once constructed, can then be used to price other OTC derivatives consistently with the markets.