Does a John deer even have a magneto? Does it fly? As others said it’s probably your coil an easy quick check with a $5 spark check tool. Someone mentioned putting a meter on it to check ohm but you might not get a bad reading with an intermittent coil issue. Start simple, obvious, easy and cheap.