Using a doubled thread- that is, one thread through the eye of the needle and then knotted with the other end, making a loop. Pull your needle through on your first stitch but before you pull it tight, slip the needle back through the loop and then pull tight. This will prevent the knot from slipping through.
Another method is to take 3 short stitched in the exact same place and pull tight. This works great for when you don't want a double thread and have no loop to thread through. HTH