There are a plethora of resources to be found online and in books to help you with this, and there are different ways to do it — but this is my preferred method.
Begin by crocheting a chain in a waste yarn — I would normally chain about 10 more than the number of stitches I want to cast on. Here, there will be 18 stitches.
Use yarn that is smooth and a little thinner than your working yarn, and a crochet hook a size larger than your needles will be. This makes a looser, airier chain for picking up those stitches.
Turn your chain over and in the back you’ll see horizontal “bumps” that resemble purl stitches.
With your working yarn, pick up stitches in these bumps. This will be the foundation of your cast on edge. If you used a waste yarn in a contrasting color for the chain, it should be easy to distinguish between the bumps and your stitches.
Pick up and knit stitches just as you would when picking up along a neckline, until you have the required number of stitches.
I prefer to pick up the stitches onto a crochet hook and then slide them (purlwise) onto the needle. It’s an extra step, but it’s the method I use for any kind of picking up and I just find it easier than trying to use a knitting needle.
Once the stitches are on the needle, just work them as you would the stitches from any regular cast on, and follow your pattern instructions as written.
When you are ready to use the stitches on the provisional cast on for adding an edging, or knitting in the opposite direction, or doing a three needle bind off, you need to release them from the crocheted chain.
Unpick the fastening at the end of the crocheted chain (helpful hint: tie a knot in the tail of this end so you know which is the start and which is the end of the chain when you come back to it) — the chain should start to unravel quite easily.
Carefully place your live stitches on a knitting needle as they become exposed — they are now ready to be worked. Make sure there are the required number of stitches on the needle — at the edge if there is one extra or one missing, now is the time to fudge it with a surreptitious increase or decrease.
Helpful hint: place the live stuiches on a smaller needle than you will be working with — it makes them much easier to pick up and you are less likely to lose one.