If you’re creating a document that needs to be distributed as a PDF, when it comes time to create the PDF, the first rule is very simple: do not use a “Print to PDF” option!
When your computer sends a PDF to a printer, it knows that all a printer needs to know is what the final page needs to look like, so it can put the right color ink in the right place on the page before dropping it into the output tray. Since that’s all the printer needs, that’s all that your computer sends.
“Print to PDF”, then, does exactly what it sounds like: it takes the information that would normally be sent to the printer, and instead creates a PDF. But since it’s only working with the image data, all that work you’ve done to choose the proper headings, add alt text to images, set headers for your tables, and everything else that makes a document accessible? That just gets stripped right out as if you’d never done it at all.
Instead of using “Print to PDF”, look for a Save As… option that allows you to set the output file format to PDF, and check the settings to make sure that accessibility information is being saved.
Not every application offers this option, of course (of note, Microsoft’s Office apps are very good about this; Google’s office apps, unfortunately, are not), but if you can avoid using the “Print to PDF” method, you’ll have a much better chance of ending up with an accessible PDF.