How to treat scars

The amputation and following surgeries left some scars on my body. Injuries during our lives also leave a mark. Sometimes even a minor wound turns into in nasty scar for the rest of our days.
Why do we get scars in the first place?