If your BMW windows have stopped working often the culprit is a defective BMW window switch. A BMW window switch may stop working due to normal wear or if rain falls on the window switch when the window is left open. In both cases, BMW windows won't go up and down and door lock/unlock feature may not work.
Typical cost to change BMW window switch at the dealership is $350 to $550. The cost to change BMW door window switches yourself is under $100. If the button has come off your window switch, replace only the buttons with new caps. There is no need to remove the door panel and remove the window switch. See links below under PARTS.