904 tranny adjustment ,starting problem

Sometimes it's the neutral safety switch, and sometimes it's just an adjustment is needed.
The best way to adjust the shifter is with the pan off and to have a second person select gears while you watch the manual lever that the cable hooks to. Watch the pointer, where it hits the neutral safety switch, the cable needs to be adjusted so that pointer returns to the safety switch each time, from both directions. (from park to neutral and from first to neutral)
If the cable is worn or the outer housing is burned, you may not get the repeatability needed and it is best to find a replacement.