Metta is one of the 4 Brahma Viharas. These heart-mind states are considered our "divine homes" in Buddhism.
Metta/Maitri (Lovingkindness, Goodwill)
Mudita (Inclusive joy)
Uppekha (Equanimity, Balance of mind)
Traditionally, the meditation is directed in this progression of categories: self, mentor or good friend, neutral person, challenging person, and then all beings.
Visualize an actual person(s) in each category if possible. Some can be more difficult than another; often at either end. Don’t rush thru a difficult category(ies) as this can often points towards a category which currently most needs attention. Know also that this is a purifying practice so the opposite feeling may arise at first or at times. Gently work thru it.
A modified version I use is below. The third line, while really a karuna/compassion statement, resonates for me in our modern, urban lives. It’s very important to be in an easeful posture and state when you do this meditation as it sets the tone for the quality that’s being generated or accessed.
May I be filled with loving kindness
May I know well-being whenever I need it
Let me know inner & outer safety here and now
May I be peaceful & at ease
Let me know true happiness in this and every moment
May all beings be filled with loving kindness
Let everyone of us know wellness
May all beings know that inner & outer safety is their birthright
Let all beings, including this one, be peaceful & at ease
May all beings know true happiness all the days of our lives