ambient voltage

So im reading pin 2 and depending on if its high or low an action is taken, but i think it reading ambient voltage because as soon as i touch the lead that connects to pin 2 it starts reading low or if i ground it it reads low. so my question is, how do i stop from reading this ambient voltage?

You need to either pull it up or down with a resistor so that it's always in a known state. Internal pullup is the easiest.