2001 Elantra would shift hard and would slip out of gear. on 2001 Hyundai Elantra

it has done this for quite some time the check engine light is on but nownit does not go into gear at all put it in drive it doesnt go when you press the gas just revs up.