If you publish in a journal that has closed access, there is generally no fee to publish.
What field are you in? In the life sciences, there’s normally a fee to publish closed-access and a higher one for open-access. My last paper was open access and costed about 3500, compared to 1500 pay walled.
no fees in closed access in organic chemistry, as far as i know. some other subfields can be different
open access can be easily two, three grands, and you better have a grant that covers this
My background is in theoretical biology, but I was mostly publishing in public health, physics, and computer science journals. We paid for every paper because I feel very strongly about research being made available to everyone, especially in the case of publicly funded work. I just make sure to budget for it.
I had a couple of papers in one of the PLOS journals, which afaik are fee-only pubs.
It’s been about ten years since I’ve had to worry about publishing, as o decided to sell out and join a commercial company, and they’re pretty averse to publishing. My information might be out of date.
I do think the academic publishing industry is atrocious, however, and I have always encouraged people to check on sites like arxiv, the personal web page of the lead author, and as a final attempt contacting the lead author directly. Most journals that I dealt with permit authors to upload preprints to sites like arxiv, and if you do it with your final revision the only difference would be the formatting. Of course, that doesn’t count as a publication for academic purposes, and it doesn’t get around paying fees for the journals that charge them, but it is an avenue for people to make their research more globally available for free. I’m sure you know of that, I’m just mentioning it for students looking for a copy of a paper.