An under-sink or inline filter is a small job on paper, and most leaks come from skipping one step, not from a difficult fitting. Before you open the box, decide whether you will do it yourself or hire it out, and read the manufacturer's install sheet for your exact model. The sheet controls over any general advice, including this article. It will specify the cold line, the flow direction arrow and any minimum pressure the unit needs.
Before you touch a pipe
Confirm which line you are tapping. The filter goes on the cold supply, not the hot. Close the cold shutoff under the sink, open the faucet to drain the line, and place a towel and bucket under the work area. Test the shutoff itself. If it is stiff, seized or drips when you turn it, that is a separate repair, and you should not make a new connection to a valve you cannot close fully.
The order of connections
Lay out every fitting from the kit against the parts list and confirm the sizes match your supply tubing. Connect the inlet to the shutoff side first, then the outlet toward the faucet or filter head, following the arrow on the housing. Hand-tighten push-fit or compression connections, then add a small turn with the correct wrench. Over-tightening plastic fittings is a common cause of cracks that show up days later.
Keep the cartridge in its sealed wrapper until the housing is connected and ready. Some cartridges need to be wetted before use, and the manual will say how. Install it only when you are ready to run water through the system.
Flush and check before first use
Open the dedicated filter faucet, or the main faucet, to a slow stream and run it for the time the manual specifies. Air will sputter out first. Put a dry paper towel on every connection, then look again after a few minutes and once more after the water has run for a while, because some leaks only appear under pressure.
Record the installation day on the housing or in your home records. Then ask one last question: could someone who did not install this find the shutoff in an emergency? If the answer is no, label the valve and the filter so the next person does not have to search.