To trim a carpet, it is helpful to use either a specialized carpet-edging tool or to cut off the excess stripe of carpet with a sharp utility knife. Another tip is to cut the carpet vertically in the corners before trimming it along the walls.
Before trimming, place the carpet into its designed space. Press the carpet tightly against the ground, and cut it along the line where the wall meets the floor. Make sure the cut is complete before pulling away the trimmed piece. Applying a fray-inhibiting liquid to the newly created edge stops the threads of the carpet from fraying.