The laptop keyboard is an essential piece of hardware in your laptop. One or two broken keys in a laptop keyboard might not put your laptop entirely out of commission, but a broken space bar key certainly can.
Separate the space bar key from the metal retainer on the back. Use a flathead screwdriver to do this if it won't come off easily.
Attach the separated metal retainer to the laptop keyboard. There are little hooks on your laptop keyboard where the space bar is supposed to be located. Engage the hooks with the metal retainer.
Position the space bar over the metal retainer and use firm but gentle force to press the key back into place.
Before you begin working, you may want to clean the area with a computer duster product. This will give you the chance to remove any dust and debris that might have contributed to the space bar becoming broken in the first place.
Not every broken space bar can be repaired. If this procedure doesn't work, you will have to replace the entire laptop keyboard.