I have a 97 TJ and the Z linkage (I think thats what is called) keeps disconnecting

The 4wd leaver just becomes loose and falls back to the 2wd position even when its in 4wd

I climbed under the jeep and the linkage is all bent and had to manually put back into 2wd

What solutions are there to fix this issue

Cost?
Hard to install ?

Any help would be appreciated