How to know that I may or may not use interrupt?

I don't think that interrupts will fix your problem.

  • It could be that you have a bad power supply - are you providing the Arduino withthe right voltage to function?

I want to make pin 12 as switch that is controlled from GUI, but so far it doesn't work well.

By this I understand that you have a GUI somewhere that sends a signal to the Arduino and the Arduino turns on the output? Or is Pin 12 an input? For either case

  • Have you actually configured this as an output? Posting your code will help to determine what is wrong
  • For inputs you need to have pull-up or pull-down resistors on the inputs so that they will work. With nothing connected to an input it is not 0, it is undefined, and it will react to fingers and moisture and anyuthing you can imagine. Look it up for details.