check if there’s any broken small pieces of plastic, if not then you should be able to press it back to where everything connects as designed
if there is broken plastic then:
a. if the broken part is on cap then it’s not the end of the world, search for parts on ebay for substitute cuz it’s very unlikely to repair the broken plastics
b. if the broken part is on the base then you’re fucked… pretty much, cuz that means you have to carefully tear down the whole thing then replace the board. considering the effort and cost you may as well just buy an external keyboard or change the laptop altogether