Needing Help With Databasing

In short I’m just tryna make a login and log out for my website but I don’t know how. I even tryed to just make a button to save all the information in a .sql and .php but was unsuccessful. And also, how am I able to use other projects code I mean who cares if I picked a html template .php code should still work no matter the template unless I did a typo or mistake.

I would recommend following this tutorial for a login with replit button, and this tutorial for databasing on replit