Some info on PhDs for fanfic writers
Mostly based on experience in the social sciences and in the US only. Look up the field your character is in! The country, too; it's not even necessarily going to be called a PhD if you get it outside the US.
Getting a doctorate takes a LONG time. Four years is a fucking speed-run.
I recently read a fanfic that casually mentioned Ryland Grace from Project Hail Mary got his PhD at 24. That is not impossible, but it's the kind of rare that should not go unremarked-upon. Tony Stark getting a doctorate at 24? I'd believe that. He's a superhero-level genius and went to undergrad at age 15. Assuming a four-year undergrad degree, that's still starting the doctorate at 19 and finishing it in five years. Bright, hard-working, but still mostly regular dude Grace who presumably started college at 18 and finished at 22? Probably not.
Where do you get a doctorate? By definition, you get a PhD from a university, not a college. The difference between colleges and universities is that universities have graduate students, colleges do not. (This is why universities are generally bigger--more degrees means a larger student body--and why courses at colleges are all taught by faculty: there are NO PHD STUDENTS to shanghai into teaching for you!) I know there are some colleges with five-year joint undergrad/Masters programs, but I'm pretty sure there are no colleges that give out doctorates. They might be able to give out honorary ones to public figures, although even that I'm not sure of. For sure, though, your currently-not-famous doctoral student character isn't getting their PhD from any institute of higher education with "college" in the name.
What do you actually do? There are usually two to three years of coursework (during which you'll also be doing research and possibly teaching), some kind of qualifying exam and/or research project (this is the "you've basically done a really intense Masters" step), and then more research--which will tend to be on your advisors' projects as well as your own research for your dissertation. The two can overlap, of course, but the point is you probably will be doing work relevant for more than just your own graduation project.
In general, the character shouldn't be taking out loans for a PhD the way you do for undergrad or an MA, especially if it's in a research field. You get paid--by your program (for at least a few years), from teaching, from being a paid research assistant, etc. But again, this might vary by field, so look it up.
So wait, how do you make money as a PhD student? I would not have your PhD student character working as a barista or bartender unless they really hate teaching, want to do something completely different from school to blow off steam, etc. Your program should kind of take care of you. How exactly they do that really depends on the field. The natural sciences have a comparatively high amount of $$$ and give pretty good stipends, although if you're writing something set right now, with the Trump administration axing so many federal grants, that might be less of a difference from other fields. You'll probably have a salary or lump-sum from your program for at least the first few years. Teaching and salaried or grant-funded research work in a faculty lab are also common ways of making money. If you have a good advisor, they'll point you toward opportunities. If you have an evil advisor, they'll "point you toward opportunities" ("Here, work on this project that you have no interest in but that will advance my career. You want to eat, don't you?").
Teaching: how does that work? You can teach college-level classes without a teaching degree. Wild, huh? You are not necessarily going to be told anything about how to teach, just given the curriculum the previous instructor used and stuck in front of a classroom. More likely you won't start out as the instructor of record, though; you'll be a TA (Teaching Assistant), grading homework, leading discussion sections or lab sections (depending on the field), having office hours, etc. (The instructor of record should give you some guidance here, although that varies!) Once you've had some experience with things like that, you might get asked to teach an intro-level course--or a Masters-level one. In a way, doc students are probably better positioned to teach people who are already fairly deep into their studies than complete beginners.
Do undergrad/MA students call doctoral students who teach them "professor"? Depends on the vibe of the school and the personality of the particular student. If the doctoral student is the main instructor for a class, probably yes; if they're a TA, it really depends.
Do you need a Masters first? Depends on the field! My understanding is that you generally don't in the natural sciences. In the social sciences, an MA is usually a "I want to work for someone at a high level" degree, while a PhD is the "I want to design the program of research" degree, so an MA is not a prerequisite for a doctorate. (Someone with an MA might end up designing research if they are The Science/Stats Person at a small company or nonprofit, but definitely NOT in academia.) However, even then there are exceptions. If you want to do research in social work, you need an MSW. There are a few joint MSW/PhD programs where you only need to apply and get accepted once, but you need to complete the full MSW program before you start the doctoral work.
Do you get a Masters along the way? This will depend on the program, so again, look it up. If it's a straight PhD program, assume not, although you might be able to get awarded one if you drop out after your qualifying exams. Some might also give you a Masters at that stage if you're applying for jobs while still finishing your dissertation research. You might have to request that, though. It's so that you have some higher education on your resume, rather than your BA and a weird long gap. (This became more common during the pandemic.)