If you are new to Arduino programming study several of the examples that come with the IDE. I'm sure there will be many that illustrate relevant techniques. Make a copy of some of the examples and learn how to modify them.
Study the datasheet for your ultrasonic sensor.
Start by thinking about your project as several separate parts and write short sketches that just do one thing - for example reading data from the sensor or sending SMS messages. Only think about joining them up into a comprehensive project when know how do do each piece.
...R