M very very new to robotics ... never had programmed a microcontroller before unless for a line follower robot. Please help me with the algorithm for ultrasonic sensor ... how to detect the object emitting sound and turn the robot to its direction

I know this society has genius robot builders and my question may seem lame to them ... but please help me with this i really need it

thanks a lot and yeah .. i made complementary statements .. ... i coded the program for line follower.. it runs well on simulation software but did'nt burn in MC so dont know exactly if it is right or not .. so u can say i have never programmed before technically!