How to stop displaying the Id without losing the functionality

the_author_meta displays the data. That is, it echos the data to the screen. From the Codex entry for that function:

NOTE: Use get_the_author_meta() if you need to return (not display)
the information.

So, use get_the_author_meta() instead.

There is a somewhat reliable pattern in WordPress function naming whereby functions starting with the_ echo data to the screen; functions starting with get_ return the data.