Google it. There's basic ways to do it with solenoids or isolators and there are also higher tech methods from Painless & Hellroaring that allow you more control. I have the Hellroaring setup in my CJ-7 and will probably do the same on my Scrambler when I get to that point.
'86 CJ-7 Laredo: 4.2,T-999,D300,D30/D44,'94 YJ tub, full cage, Shrockworks rockers, OYR corners, AC,cruise,restored seats,3 tops,2.5" Superlift,F-T shackle reversal, RS9000x's,35" Dunlop Mud Rovers.
'83 Scrambler: time & money pit under construction with parts from CJ's,YJ's,TJ's,FSJ's,GM,Ford,IH,Honda,Toyota and a whole lotta aftermarket & custom stuff.