I have a 1998 Ford Contour and my car will erratically shift gears?

Check engine light is on so AutoZone plugged it in and it said "Transmission Range sensor". I bought one but where do I put the new one in? IT IS A 6 CYL, NOT A 4 CYL. I saw a youtube video for changing a 4 cyl but not a 6. Is it in the same place? Same access to it?

Same location

Same transmission: Ford CD4E. Slightly different access, since there's more stuff under the hood in the V6 models; do not be surprised if you have to take off a wheel.