See if you can procure a can of compressed air at any office supply store and try blasting air under the spacebar. If there's some debris under the keys it can cause issues. Do not turn the can upside down or you will dispense super cold propellent that can cause frostbite burns. Start with the MacBook turned off and work the keys as you try to spray under them. When the can becomes cold, stop wait a few minutes and try again.
If there is any possibility that something liquid may have been spilled on the keyboard, you should immediately take it in for service. Over time many liquids can have a corrosive effect upon electronic components causing solder joints to fail and short circuits to occur. The sooner you can service a laptop with a spill the better, it needs to be dissembled and properly cleaned. This is not recommended for someone without the proper tools and experience. Apple Authorized Service Centers would be highly recommended.
Do not eat over your keyboard, crumbs and food particles definitely can enter under the keys and cause issues. It's something I frequently come across. I once had a customer who ate breakfast bars over their laptop every day and we had to replace the internal keyboard on their PC laptop.