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

I want to make pin 12 as switch that is controlled from GUI, but so far it doesn't work well.
When I make pin 12 as the OUTPUT, it is not really stable to hold the switch in HIGH voltage (5V),
so I think it might be due to waiting for another code executed, so I think I should use interrupt to fix it.

My analog pin in Arduino UNO is not really stable, even if I have set them (A0-A5) as output not input, always be disturbed by my finger or anything around it.
Even if I put my sensor on A0, but the GUI show that A1 and A2 also like detect something A0 detects, it's weird.

I think the interrupt is the way to fix it, so the pin responds only if there is input from user and sensor.

I hope it is clear enough, do not hesitate to ask.

Thank you.