How to connect MCU input pin with LED and Button?
Sure.







simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. Two options.

R3 and R4 added as per Spehro's comment.

When the button is pressed it pulls the GPIO to a well defined voltage. When the button is released it needs to be pulled to the opposite logic level (other voltage rail). This is done by a pull-up (a) or a pull-down (b) resistor. I assumed that the LED and series resistor would do that for you. Spehro (who actually does this stuff for a living) cautions that a separate resistor may be required due to the LED being in circuit and making the pull very weak.