rc car that stops when object is in front of it

hello, i am new to arduino and have done some basic things with arduino such as blinking LED, make a servo turn, and get a proximity detector to work. I want to start a bigger project but I have no clue where to begin.

I want to put a proximity detector at the front of the car and when an object is X distance from it to have the car stop. Here is what I have:

-traxxas stampede RC car

-arduino uno


-jumper wire



I am pretty good with the hardware and how to set that up, but I am pretty lost in the software/programming part. Any help will be greatly thanked. If you give me code, can you explain what it means.