Usually, it is just the actuator on the transfer case that is malfunctioning. This is not an expensive fix. You should go to your mechanic or local auto parts store and have them hook up an OBDII scanner to the car and check for any fault codes. Many auto parts stores will do this for free. This will tell you if any specific parts, sensors or modules are malfunctioning and need repair or replacement. It will save you hundreds of $$$ if you know what is wrong before replacing a lot of expensive parts. If you need help with the codes and what they mean, just come back here and we will try our best to help. Good luck and let us know if you have any follow up questions!
The way to thank the people that help you here is to click on the “thumbs up” button on the bottom of the answer. Please do so if you find their answer helpful or they may just stop trying to help in the future!