Sodium chloride is just common salt (the same stuff you put on your fish and chips).
Sodium lauryl sulfate (SLS) is a surfactant (surface active agent) - it has a hydrophilic head (the sulfate bit) which mixes well with water, and a hydrophobic tail (the lauryl bit - which is a hydrocarbon chain) - which mixes well with fats and oils. So in a shampoo, this acts to remove oils and dirt from the hair, by forming "micelles" around oils/dirt - where you have a blob with the oils/dirt in the middle, surrounded by the hydrophobic tails of the surfactant molecules - with the hydrophilic heads of each surfactant molecule pointing outwards towards the water - so that the oils and dirt from the hair can be easily washed away when the hair is rinsed.
As for the sodium? The sulfate bit of the surfactant molecule is negatively charged, so you need something with a positive charge (e.g. Sodium ions) to balance it out. Potassium ions would do a similar job, for example.