Every key on your keyboard consists of the actual button, and a plastic mechanism that lifts the button when you're not pressing it.
If the plastic mechanism came off as well, put it back onto the board first. (The plastic mechanism might be attached to the button, remove it from the button and put it onto the board.) Then carefully push the button back onto the board.