Sonar sensor to arduino to servo

Think of arrays as a row of houses.

You can refer to any house simply by specifying the house number (the number in the square brackets).

got stuck up here

I'm sorry, but from here, I can't see what you're stuck on, so you'll have to show me.