How can I send a message to all players in the minecraft server?

You'd want to use say:

  say <message …>

Fails if any target selectors do not resolve to at least one online player, or if any named players are not online.

On success, broadcasts message to all players on the server. If a multi-person target selector (e.g., @a) is used in message, the list of names is formatted as "name1 and name2" for two players, or "name1, name2, ... and nameN" for N players. Target selectors are not recognized in Pocket Edition.

For example: say Hello world

https://minecraft.gamepedia.com/Commands/say


Just press t and type the message and press enter