You cannot use cooking oil as a lubricant for an electric fan as it doesn't have good enough lubricating properties for the electric fan bearings.
Cooking oil is prone to oxidation and rancidity which can cause issues with the electric motor bearings.
Instead when lubricating an electric fan motor bearings you should use a low viscosity engine oil or machine oil or 3 in 1 oil or even 3 in 1 motor oil.
Using cooking oil to lubricate the electric fan motor bearings may work short term but eventually it can cause the electric motor of the fan to seize up and damage the motor.
To lubricate a small electric motor you can use some 3 in 1 motor oil and add a few drops of the 3 in 1 motor oil to the oil port if it has them or you can take apart the motor and add a few drops or so to the electric motor bearing and the cotton like thing that is around the bearing in the electric motor.
When oiling an electric motor you put between 2 to 4 drops of oil into the electric motor for each bearing, depending on the size of the electric motor.
Generally you can just put the oil into the electric motor a drop or two at a time until the oil reaches the top of the oil port.
Avoid over oiling the electric motor though as it can cause damage.
Electric motors require oil if the electric motor has oil ports which are located on each end of the motor housing where the motor shaft exits the motor.
Some electric motors have sealed bearings and don't require any oil and if there's no oil ports or grease ports the electric motor does not need any oil or grease.
But if the electric motor does have oil ports or grease ports they need oil or grease to keep the bearings lubricated.
The kind of oil that you use in a small electric motor is often 3 in 1 motor oil or SAE 20 motor oil.
The best oil for electric motors including small electric motors is 3 in 1 motor oil or SAE 20 motor oil.
3 in 1 motor oil or 3 in 1 oil in general is best for electric motors for lubrication.
3 in 1 motor oil is the best for electric motor bearing lubrication.
SAE 20 motor oil can also work in electric motors for lubrication.
WD-40 is OK for electric motors when cleaning and freeing up any stuck components although WD-40 shouldn't be used as a lubricant for the bearings as WD-40 is not an actual lubricant but is instead mainly a cleaner and penetrating solvent.
3 in 1 motor oil is different than the regular 3 in 1 oil.
Some larger electric motors may require grease or a thicker oil depending on the size of the electric motor although most household sized electric motors can use 3 in 1 motor oil or SAE 20 motor oil.
10W 20 motor oil or other light oils can also work for small electric motors.
And for electric motors that need grease, the grease consistency preferred for electric motors is normally NLGI 2 or 3, with a base oil viscosity of 100-150 cSt @ 40°C or 104 F.