Open your profile by tapping on your profile picture in the bottom-right corner.
Tap the cogwheel in the top-right corner.
Scroll down until you find "Advanced" and then tap it.
Make sure "Developer Mode" is turned on.
Long tap on any user's name inside a conversation.
Tap on the three horizontal dots in the right corner.
Tap on "Copy User ID".
Note: Discord may update its UI interface in the future which means that some steps here might change, but the general idea is the same.