need help,car dies,then starts right back up

My buddy had a 2000 buick with same problem it ended up being his crank trigger electronic sensor went on and off drove him crazy, would do it then start right up and run for days and then just stop running again so we towed it to the shop and the guy found the problem and somehow the mechanic "hotwired" it and its still running never misses a lick! So check that