The overcasting foot is a very handy substitute to an overlocker. It is designed to guide the fabric edge so the stitches are sitting on its very edge. The part in the middle of the foot opening adds stability when the needle is reaching the edge. Have a look into your sewing accessories because this foot is often coming with the sewing machine.
To overcast knits with an overlocker (serger) machine, you serge cutting away the excess of seam allowances because the machine has a blade. With a standard machine, the blade is not there so you need to trim the excess yourself and then overcast. Here I recommend you to assemble the matching seams first with a straight stretch stitch. If you do not have one, choose a very narrow and show zigzag. This is an extra step, but it is worth because the stitches can be used as a guide to trim evenly and it will add extra stability to the knit. Stitching on the edge of a knit can be tricky, even with the handy overcast foot.
For stretch-proof seams, all-purpose thread for the needle and for the bobbin textured thread.
Then, use the stitches as a guide to trim down the seam allowances to about 6mm (¼").
Set your machine to a 6mm (¼") wide zigzag stitch or an overlock stitch. On my Brother CS-4000, I used the stitch no.7. For the straight stretch stitch I used the no.3.
Install the overcasting foot and overcast on the edge of the fabric. Note that if you choose an overlock stitch, the machine will go back and forth. Do not stretch the fabric while doing so. If your seams are wavy, try with a slightly longer stitch length.