@Foster’s way is probably best, but reviewing these might help…
VEX Mecanum Drive using ROBOTC
Help with v5 mecanum wheels Programming
There are many more, these were from the forum search and Google for “vex x drive code”. More can be found under “omni-wheel drive” & “holonomic drive” & “mercanum drive”. Along the way you see other good bits about tuning, and of course PID…
I suggest you not limit your studies to solving immediate goals, but research related subjects, and coding in other “languages” and programming environments.