I wanted to know what's the best ISO value to use when shooting?
At first glance, the best ISO seems obvious—ISO 100 (or, in some cases, 50), because it gives you the lowest added noise; if you can't get a good shot at ISO 100, you need better lights. :-D
On the other hand, it could be argued that the best ISO is 12,800, because it lets you shoot in dark areas when you forgot to bring all your studio lights; if you can't get a good shot at ISO 12,800, you need a better camera. :-D
But in all seriousness, snark aside, there is no best ISO. The lowest ISO gives you the lowest noise, and the highest ISO gives you the highest gain (amplification), letting you see small amounts of light.
In an ideal world, cameras would be able to reproduce the entire electrical output of a given pixel with enough precision that we wouldn't need an ISO setting; it would be set permanently at 50/100 (the base ISO) and the circuitry would accurately reproduce everything from zero photons up to the point where the sensor physically saturates (full well capacity).
In practice, cameras don't work that way. They have limited bit depth analog-to-digital converters (ADCs) and try to make up for that deficiency with analog gain (like turning up the volume control on your TV). That analog gain adds a certain amount of noise, bright areas clip by going off-scale-high (brighter than the largest digital value that can be represented), and dark areas are pulled up out of the mud so that you can tell the difference between black and really, really black.
The goal is to get most of the image area (and, at a bare minimum, the most important parts of the image area, like people's faces) to fall between the highest digital value that the hardware can express and the lowest digital value, so that nothing important gets clipped on either end.
So in a theoretical, ideal world, the right answer is ISO 50 or 100 (the base ISO), with a 24-bit ADC measuring the value of each pixel precisely, thus rendering the analog amplification completely unnecessary. But in the real world, the right answer depends balancing three main factors:
Aperture: Optically controls brightness. Wider apertures bring in more light, but also make focus more critical, causing areas behind and in front of the subject to be more out of focus. This can be good or bad, depending.
Shutter speed: Temporally controls brightness by determining how long the camera gathers light before recording a picture. Slower shutter speeds give you more light, but cause moving objects to be smeared (motion blur). This can be good or bad, depending.
ISO: Controls brightness through amplification. More brightness = more noise. Noise is, of course, bad, but is less bad than having a smudge because you couldn't stop important motion, or having critical parts of the image be out of focus because you used too wide an aperture.
So basically, the answer is that you need to figure out a reasonable shutter speed first—based on how much motion you need to stop—then figure a reasonable aperture based on how sharp you want foreground and background objects to be. Once you've set those values, you pretty much have only one plausible ISO setting that won't overexpose or underexpose the shot.
The best ISO setting is the one that lets you expose satisfactorily with the shutter speed and aperture your composition requires.
What is the "exposure triangle"? discusses the relationship between those three variables.
The lowest ISO value is usually the best in terms of getting the best image out of a sensor. Increasing the ISO value tends to add noise and reduce dynamic range. But do not be afraid to increase ISO to get a higher shutter speed when needed. A low shutter speed can degrade an image more than a high ISO. Slight motion blur due to a low shutter speed and camera shake can reduce the sharpness of an image.