How to avoid self-plagiarism when adapting dissertation into a paper?
The dissertation is not a published work in the same sense as a journal or conference paper.  It is normal for a recent graduate to take large chunks of their thesis, with minimal or no modification, and use the excerpts in more formal publications.  You do not need to worry about self plagiarism in this context.

The copying often goes the other way as well.  If you already have published papers when it's time to write your dissertation, you may take large chunks of the published papers and reuse them in the dissertation.  In some fields (mathematics or theoretical physics, for example), this is quite commonplace.  People talk about "stapling your papers together" to make a thesis.  In reality, there is more to it than that.  Introductory and concluding material are needed, but many theses have chapters that are based on published manuscripts, with relatively little editing.