The Auth docs explain the process to get a User token https://dev.twitch.tv/docs/authentication/getting-tokens-oauth
You need to either use the Imiplicit Code Flow, which will generate a token that will last ~60 days but after it expires you’ll need to get a new one.
Or the authorization code flow which will return both an Access Token (that lasts ~4 hours), and a Refresh Token that will allow you to programmatically create new tokens when needed.