Helix searching user by username returns 401 error

a HTTP 401 like what you got from specifying no token at all.

First you need to determine if you need a token that represents a user, or just a server ot server token that lets you fetch public data, give you are calling a user by login you probably need an app access token, that is documented here

Make a POST request, get a token, back maintain that token (it expires every 60 days or so), use that token with your requests to the Twitch API

Don’t need this header with Helix