How do i code for a robot which moves exactly 50cm in a straight line
First, the Arduino has no way of knowing, unless you have sensors attached, that it is moving in a straight line.
Second, the Arduino has no way of knowing, unless you have sensors attached, that it has traveled 50 cm.
So, the simplest solution to your problem is to make the robot move on a rail, and put a wall at the 50 cm. mark.
and then takes 60∘ clockwise turn
How is the Arduino supposed to know that some other device has turned exactly 60 degrees?