Knit stitches and purl stitches look different on the needle. A knit stitch looks like a loop on the needle and like a v in the knitted fabric, while a purl stitch on the needle looks like a knot and in the fabric looks like a ridge.
If you're alternating knit rows and purl rows, look at the last row you knitted. If the stitches are flat and look like vs, you've just knitted and it's time to purl. If you see knots and ridges, then it's time to knit. If you stop in the middle of a row, look at the stitches you worked before on the same row.
If you're working on a more complex stitch pattern, you'll need to look at the individual stitches. This is easier to do with some yarns than it is with others, but with time it will get easier for you.
When working on a complex pattern with a long set of rows you need to keep track of, you might want to keep track of which row you are on by using a row counter or marking down on a piece of paper each time you finish a row.
If you are knitting a sweater or another big piece with a lot of written instructions, make a photocopy of the pattern and use a highlighter to mark each line as you complete it. Or if you're using a chart, you can highlight each row of the chart as you go.