Adding a resistor or a capacitor

I'm using a sketch that contains simply a non-contact thermal sensor, nothing else. It works but is slow to show the changed readings when moving the sensor. ( Move the sensor and new readings will start to show but they take time to stabilize on the correct value), it is as if the current readings need to be flushed out.
Should I add a resistor or a capacitor and if so what size?

What sketch would this be?

From the limited information you have provided (e.g. you haven't told us what type of sensor it is), I guess that the problem is caused by the thermal time constant of the sensor - in other words, when you move it to a different environment, it takes a while to heat up or cool down to the new temperature. If you need a faster response, your best bet is to use a smaller sensor (with a correspondingly lower thermal time constant). For example, use a surface-mount version of the sensor. Alternatively, improve the thermal contact between the sensor and whatever it is you are trying to measure then temperature of (if it isn't air).

You may be able to speed up the response a little as follows. When you take a new sensor reading, work out the temperature like this:

adjusted_temperature = current_reading + (current_reading - previous_reading) * (K/time_between_readings)

The idea is that if you detect that the temperature is rising, it is likely to go on rising, to an extent that depends on the rate at which it is rising. Similarly if it is falling. You will have to experiment with the value of K. if the time between readings is constant, then you can use a single constant to represent the value (K/time_between_readings).

A disadvantage of this scheme is that if your readings are affected by noise (e.g. because you are using an analog sensor and have both it and other things connected to the same Arduino ground pin), then the noise will be amplified.

[EDIT: I am assuming that your sketch doesn't contain any mechanism that deliberately slows down the response, such as averaging several readings.]