Liners help contain the combustion products created whilst the fire is on, it also helps direct the combustion products outside, they also protect the chimney walls from heat and corrosion. These should only be measured and installed by a qualified person.