In another thread I demonstrated the flow used to create OAuth-In apps. While it wasn’t the original intention of the post it turned out I’d demonstrated how you could effectively replace a PAT for many common uses without having to do too much work.
Regardless of that, I recommend you have a good look at the developer documentation, and in particular the section on connected services to get a feel for what is going on and links to example apps and SDKs.