expression, godan verb (-u)
with good intentions; thinking it's for the best
Often used in the form 良かれと思って to describe acting with good intentions, sometimes with an implication that the outcome was not as expected or caused trouble.
良かれと思って手伝ったのに、かえって迷惑だったみたい。
I helped thinking it was for the best, but it seems I only caused trouble.
彼は良かれと思
He gave advice with good intentions, but the other person got angry.