If copyright has expired (usually 50 or 70 years after the author's death in most jurisdictions) or if the work is in the public domain, you are free to republish their work. If the copyright still applies, you need to obtain permission from the copyright holder (usually the author, but often their family or the publisher).
You question title uses the terms publish and print interchangeably, but legally they aren't synonymous. You can print anything your want for your own private use, even if it is still under copyright. But if you want to publish something – that is, distribute a text to others – you need to obtain the rights to do so.