@xtreemsurf
If you have a 12v fan, then you need to have an external 12v power supply to run it. The RPi only provides 5v max.
Here is a drawing how to solve it with a transistor. I just gpio14 to control it, but you can use a pin of your choice. I used a 5v fan
https://forum.recalbox.com/topic/3704/push-button-on-off-script-problems/10