How do i Remove the camshaft position sensor and install it on 1998 Nissan Altima

My Nissan cranks and sometimes doesn't want to start runs rough and it makes a lot of vibration noise on the passenger side Im guessing part of the problem is the crankshaft position sensor reason why because there's a lot of oil leaking from there how do I remove and install that sensor

Asked by for the 1998 Nissan Altima
I would be more concerned with the oil leak and also the cause of it 'running rough'. The fact that it runs, to me, points towards other issues as being more of a priority for your money.