4 wheel drive on ranger does not work

4 wheel drive light stays illuminated and the truck is in 2 wheel. Changed transfer motor and doesn’t make any difference. When I push the switch to change drive status all I here is a clicking noise in the box behind the drivers side jump seat.