This is about the meaning of Dumbledore's quote “it does not do to dwell on dreams and forget to live”
From the Time article, "10 of the Most Magical Harry Potter Quotes to Inspire You":
"It does not do to dwell on dreams and forget to live"
Book: Sorcerer’s Stone
Who said it: Albus Dumbledore
Context: Upon finding Harry gazing longingly into the Mirror of Erised — which shows anyone who looks into it their deepest desire — Dumbledore tells Harry that he is going to move the mirror before warning him not to go searching for it again. The headmaster’s words are a reminder that dwelling on what might have been in the past or what could be in the future distracts from living in the present moment.
There is a clip on YouTube here (said around 3:47).
But what is the grammar behind those words? Is there a phrase "it doesn't do" meaning "it's not good to"?