“’Tis better to have loved and lost Than never to have loved at all.”
Love can remain worth having even when it ends in loss, because avoiding grief by avoiding attachment would also remove the relationship itself.
Source details
In Memoriam A.H.H., Canto XXVII, closing stanza; represented by the Wikisource canto transcription and independently visible on printed page 44 / scan leaf 64 of a public-domain edition. Tennyson's 'loved and lost' conclusion belongs to the elegy's grief for Arthur Hallam and its argument that love remains valuable despite bereavement; it is poetry, not a clinical grief prescription.