The docs have a step by step guide: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth
What it boils down to is you first send the user to a Twitch auth page asking for certain permissions.
The user then Accepts/denies those permissions and is sent back to your page
If you’re doing client-side API requests you’d use the Implicit flow and have an access token in the URL hash. If you’re making requests server-side you’d use the Auth Code flow and will have a ‘code’ querystring param, which your server can exchange for an access token and refresh token to get new tokens each time they expire.
If you’re just doing this for yourself, you can just use http://loclahost, which will 404 if you’re not running a web server but you can still copy the required bits out of the address bar on your browser. If you’re wanting other users to utilize your app you’d need to run a web server.