The Authentication docs https://dev.twitch.tv/docs/authentication have a step by step guide, that starts with registering your application which will give you a Cilent ID and Client Secret which are used with the OAuth process.
After you’ve created an app you can use the Implicit or Authorization Code flows to get a token (the auth code flow https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#oauth-authorization-code-flow will likely be best as the token can be refreshed when it expires).