Location and language of GPIO code

Hi friends

My homidity seinsors arecorrect. are 3v3 . my relays are 3v3 there is no problem. the point is the programmin
regads

Just a couple of questions:

If I have an light indicator where do I declare the external input?
and
If I have a button Where do I declare the external output?

Thank you

Regards