Wavy edges often happen because of incorrect tension on your edge stitches. The main rule: always slip the first stitch of the row without working it (as if it's already been worked), then work the last stitch normally. When you slip the first stitch, keep the yarn on the wrong side - that creates a neat edge. Your tension should be even; don't pull the edge stitches tight and don't leave them loose. Try slipping the first stitch with the knit side of the needle, even if you're working purl rows - that gives a neater edge.
One more thing - check if your edge stitches are too wide. If the edge is wavy on smooth fabric, you might be closing off stitches wrong at the end. Edge stitches should be the same size as your main stitches - if they're noticeably bigger, the fabric will wave. Try experimenting on one project: knit a few centimeters the regular way, then a few with slipping the first stitch, then with tight tension. Once it's done, you'll immediately see which method works best for your needles and yarn weight.
One more tip: pay attention to the yarn itself. With some materials - especially slippery or very thin ones - the edge just doesn't form well because of how they physically behave. In that case, a weight helps - clip it to your last stitch while knitting so your tension stays constant.