Sounds like a dead battery. The battery has enough reserve power to operate the headlights and the starter solenoid; the solenoid is the clicking sound you hear when trying to start the car. However, it doesn't have enough power to actually turn the starter. A dead battery is caused by either: 1) battery malfunction, 2) battery useful life ended, 3) alternator cannot properly recharge the battery. Based on the age of your car (2001), I suspect #2. Have the battery and alternator tested. Replace as necessary.
2002 Titanium Silver 330ci
Steptronic, Sport, Premium, Heated seats, Bi-xenon