2002 Nissan Xterra

why does my car not start I was driving and the car cut off Hickory pack up and come off again this happened a couple times now it doesn’t start it turns over but it won’t start. I am NOT getting a spark from the plugs what do I need to do and how to do it the cheapest way?