Open User Settings by clicking on the cog wheel in the bottom left.
On the left-hand side, scroll down to "Advanced" and make sure that "Developer Mode" is turned on.
You can now right click on any user and press "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.