Unless the key cap came loose and was improperly reseated causing damage to the key cap or scissor mechanism, more than likely there is some debris beneath the key or some liquid has gummed up the key or the key mechanism. Try cleaning the keyboard using the instructions in this Apple article making sure to keep the can of compressed air completely upright or you may damage the laptop with the cold wet propellant:
How to clean the keyboard of your MacBook or MacBook Pro - Apple Support
If that does not work, then have Apple or an Apple Authorized Service Provider (AASP) examine the laptop. If only one key is affected, then they should be able to remove the key cap to remove any debris or liquid residue (an AASP is more likely to do this than Apple themselves). It can be tricky to remove a key cap & reinstall the key cap and clean the scissor mechanism & key bay. The plastic of the key cap is very thin & easily damaged plus the clips are very easily damaged as well. The key caps for different keys and keyboards may be connected differently (even for the exact same model since Apple usually uses two different vendors for parts).