Find any ultrasonic sensor tutorial and change anywhere where it uses a pin number (5, 8, 12, etc.) to any analog pin (A0, A2, etc.)
So like
digitalWrite(9, HIGH);
becomes
digitalWrite(A0, HIGH);
Just remember to wire it right.
EDIT - Learn Arduino before building a robot. Learn the coding language, or at least the basics. Learn what all the pins do and why, etc.