You could try running the Apple Hardware Test (Using Apple Hardware Test - Apple Support) though it is more likely that it was a software issue. What were you doing when the keyboard/track pad stopped working? What was on the screen (spinning beachball, regular cursor...)? In a jam, you can always force your MacBook to shut down by pressing and holding the power button until it powers down, and then rebooting.
This may be a one-time glitch. If it happens more frequently than almost never, contact Apple Support (Apple store, if you are near one, or on-line) and get there assistance. If your MacBook is new, you are still under Apple Care, even if you didn't pay for the extended coverage.