The best and safest way is to have it vacuumed out by a nurse using a special implement. If your surgery does not provide this service ask if there is a hospital near you that does it.
I have had ear problems over the years because I wear hearing aids and I was told by my audiologist never ever to put olive oil in my ear despite the advice of doctors/nurses. It is certainly not necessary if you have earwax extracted by the vacuum method, although I understand it is used to soften the wax when it is syringed out.
For many years I've used a few drops of 3% or 6% Hydrogen peroxide for ear wax.
First one ear keeping the head on one side for about 5 or 10 minutes and then the other ear. It fizzes and bubbles as it dissolves the wax. Never had problems with it and it's cheap enough from the local chemist.
Go do your GP surgery - no need to see the doc, most practice nurses these days are trained in ear syringing. As suggested, they will probably suggest a few drops of oil in the ear before the procedure is undertaken - but they will advise when you make the appointment.