... by opening https://web.telegram.org/ in a Browser:
Open the group's chat window and inspect the URL: https://web.telegram.org/#/im?p=g[GROUP_ID]
⇒ the chat ID will be -[GROUP_ID]
(prepend a minus)
The chat ID is an @ sign, followed by the channel's name.
Open the channel's chat window and inspect the URL: https://web.telegram.org/#/im?p=c[SOME_DIGITS]_[EVEN_MORE_DIGITS]
⇒ the chat ID will be -100[SOME_DIGITS]
(prepend a minus and 100, leave out the underscore and following numbers. The ID is always a 13 characters negative integer).
curl -s -X POST https://api.telegram.org/bot${apiToken}/sendMessage -d chat_id=${chatId} -d text="Hello World"