Pathfinding is jittery

I made a pathfinding npc following both parts of this tutorial, but after testing it and going over other posts, I found that using heartbeat is not good for pathfinding, as it creates a lot of useless waypoints. What should I use as a replacement?