As its author defines it, tagpdf is “a package to experiment with tagging with PDFLatex and LuaLatex”. It provides low level commands to make these compiler output appropriate “tags” within PDF documents in order to make them compliant with PDF/UA (and therefore accessible!).
Unfortunately, this package must be leveraged at a very low level in the LaTeX typesetting process in order to get acceptable results; therefore, you often need to “patch” existing LaTeX commands and TeX primitives. Some examples are provided within the package repository.
WARNING: generating accessible PDF documents out of LaTeX files is a complex task. Such complexity depends on various factors: therefore, you can get results with varying quality degree.