Method 1: Use a backslash
In a Discord message, type a backslash immediately before a custom emoji and send the message. Discord can display the emoji's raw code, including its name and ID.
Example
\:wave: This works with custom emojis. The exact result may vary depending on the Discord client.