Idk if this is the best way, but I've always done it like this
function MyCommandF( ply, text )
if ( string.sub( text, 1, 8 ) == "/suicide" ) then
ply:Kill()
end
return false
end
hook.Add( "PlayerSay", "MyCommandH", MyCommandF ))
Obviously, you would edit line 2 depending on the command
The second number in ( text, 1, 8 ) being the length of the message in the quotes
And the string being whatever you want the chat command to be