Step 1 - Disconnect your Surface from it's Dock or power adapter, if one and remove any USB devices plugged into the Surface.
Step 2 - Use the touchscreen to save everything that's open, and fully shut down the Surface.
Step 3 - Gently grasp both the Surface and Type Cover and pull them apart. They are held together by magnets that should gently separate.
Step 4 - With the type cover removed, power the Surface back on and let it get to the Windows lock screen with the time.
Step 5 - Reconnect the Type Cover by slowly bringing the Type Cover connector near the bottom of the Surface and they should magnetically snap into place.
Step 6 - Test this now but pressing on the trackpad or pressing the Windows button a few times.
Note - You can do another test after step 5 by pressing the Caps Lock button on they keyboard and seeing if the little white light illuminates. If it does, they Type Cover should be all working, if not, there is probably a hardware issue.
Note - After step 4, you can check the condition of the connectors on the Type Cover and Surface and make sure nothing is obstructing or corroding the connection. Connector locations can be seen below.
Connector Location on a Type Cover
Connector Location on a Surface