I can offer some obvious advice and tips based on one stubborn cotter pin job I did recently.
1. Ensure the crank arm is fully supported on something very solid, e.g. a brick. (In the past I just used to hammer away at cotter pins with the bike bouncing on its tyres, wondering why the pins always bent).
2. Ensure the blank end of the cotter pin is NOT supported at all and is free to fall downwards.
3. Some say put the nut loosely on the pin to give more support - I think this is futile on a difficult pin.
4. Strike hard with a heavyish hammer - use a punch or a second small hammer against the pin to protect the rest of the components from accidental damage.
5. OK, so now you've reached the 'oh sh!t, I won't be able to reuse this cotter pin' stage, with the pin now being seriously bent and squidged into the crank arm, it's time for drilling and sawing. I tried some blowlamping but it made no difference.
6. Saw off the top of the cotter pin and punch a suitable dimple in the centre to direct the drill bit.
7. This is where I went wrong. If you're impatient like me, stick the kettle on and take a break. Do not go merrily drilling the pin. I did and discovered that when the drill bit meets the hardened steel BB axle, it wanders off course and begins damaging the soft metal crank arm. You need to drill carefully, starting with small drill bits and keep testing whether to pin will come out, with the usual force, without further drilling.
Good luck.