I assume you mean in a car's engine.
To get the best answer, you need to be more specific.
First, drain the engine's oil.
Second, disconnect the electrical connector from the sending unit. (usually one small wire with a push on/pull off connector)
Third, use a socket which fits over the (usually six) flat sides of the sending unit.
This may be a standard socket, OR,
You may need a special socket to remove the sending unit. You may be able to loan out the tool needed from AutoZone or you can buy it from NAPA auto parts.
Fourth, turn the tool counter-clockwise.
Installation is the reverse of removal.
where is the oil sending unit on my 2000 bonnieville
We need to know which sending unit you speak of. There are several on that vehicle such as temperature sending unit, oil pressure sending unit and fuel gauge sending unit.
Remove oil sending unit and replace with a mechanical gauge
Bad connection at wireing connector at the oil sending unit. Bad sending unit. Replace as needed.
The oil pressure sending unit is located right above the oil filter.
you have to remove the oil pan and replace the pump
The sensor screws into the side of the oil pan. You will need to drain the oil and then replace the sensor.
The oil pressure sending unit is removed by disconnecting the wiring harness and unscrewing the unit using a wrench. The hole is then wiped clean, a new unit installed, and the wires reattached.
The oil pressure sending unit on a 302 ford is located on the block of the engine. It screws into the block and the sending unit goes on the end. The oil pressure sending unit on a 302 Ford is slightly above and to the left of the oil filter. I find it is easier to replace with the oil filter out.
Replace oil sending unit with a manual gauge
Probably you need to replace the oil pressure sending unit. It is located on the engine down close to the oil pan. If the sending unit is leaking oil then replace it by all means. Doubtful that the oil pump is defective.
It developed an leak and then for whatever reason sealed itself. Replace the oil pressure sending unit.