battery is low charge. Take it for a long drive, to take the load off the engine from the alternator charging it.
Try to clean your throttle body. If you disconnect your battery or get a bad connection your throttle body will act up if it is dirty and it will not idle.
Check the idle sensor if you have one.
Loud idle? no, not turn over ,yes
the idle solinoid may need changing, or its power source is not plugged in or working. If the solinoid is not powered the carby wont know where to idle, it will drive fine but wont idle when you pull up at lights ect.
dead battery or bad starter (with the clicking, I'm 95% sure its the battery)
If you have just changed the battery and you haven't driven car much you need to wait a little while the ECU leans all parameters. In case you drove your car for a while and it's still doing that, erase all codes from the ECU memory.
yu gotta program it
1998 rav4 engine wont idle and clacking noise from under timing belt cover
You wont lose the code by changing the battery. Just open the back and replace the battery . Make sure you use the correct battery and install in properly.
check your wiring to selinoid and relay and battery posts also make sure plugs and or wires are good and check the battery
Check spark plug wires, and voltage on the distrubutor.
check your battery then the connections if it still wont start try changing the starter solenoid if possible