How To Provide For Carpet Edging?
There are many options for the transition from hard flooring to carpet, and the method of securing the carpet depends on the option you choose.
You could have the cut carpet edge end in a metal strip of the color you prefer. In this case, there are strips that act as a tack strip, wherein the carpet is gripped by the strip itself and tucked under a decorative cover. For these, the metal strip would butt directly against the edge of the hard flooring:

You could use a traditional tack strip and cover the edge of the wood and the cut carpet edge with a rabbeted wood strip, stained and varnished to meet your aesthetic: