The parts of the body that are used extensively became larger and stronger. If not used they deteriorate.
Present day giraffe evolve from short necked antelope stretched their neck to reach leaves on higher branches.
Present day snakes evolve from reptiles having legs as they did not use their legs for locomotion. Legs were deteriorated and legless snakes were evolved.