It depends a great deal on the game, but text chat almost always works the same way: press Enter, type your message, then press Enter again to send it.
Voice chat is the other common option, usually bound to a push-to-talk key you can set in the controls menu. If neither seems to work, check whether chat is restricted by the server or your account settings.