Measure the thickness of your carpet with a measuring tape, and make a spacer about ¼ inch thinner than the carpet. Use cardboard or wood scraps to make the spacer.
Place the spacer against the wall, and line up tackless strips along the wall, held away from the wall by the spacer. Nail the tackless strips in place with a hammer, with the tacks angled toward the wall. If necessary, cut the tackless strips to fit with a handsaw, taking care to avoid the sharp tacks with your fingers.
Cut the carpet pad under the carpet with a utility knife so that it ends flush against the edge of the tackless strip.
Measure the carpet against the wall, and trim the carpet with your utility knife so that there is just enough carpet to fold over the top of the tackless strip into the space between the strip and the wall.
Stretch the trimmed carpet edge over the tackless strip, and push the carpet into the space between the strip and the wall with a putty knife.