Have you read the
NI Tutorials, especially the "Line Following Tutorial" and the "Timed Movement VIs for Autonomous Mode Tutorial" or watched the videos at
frcmastery.com especially "Step 5 - Turn on Autonomous Mode" and "Exploring the default autonomous code"?