OAuth 2.0 is the modern standard for securing access to APIs. You can try out the OAuth 2.0 Playground here which will help you understand the OAuth authorization flows, and show each step of the process of obtaining an access token.
The examples walk through the various OAuth flows by interacting with a real OAuth 2.0 authorization server.
https://www.oauth.com/playground/client-registration.html?returnto=oidc....