The 38-year-old duchess of Sussex addressed Floyd's death in a graduation speech to her former high school, Immaculate Heart High School in Los Angeles, on Wednesday.
Floyd, a 46-year-old black man, died last week in Minneapolis, Minn., while being restrained by a police officer who knelt on his neck. Protests over Floyd's death have since been happening across the nation.
"As we've all seen over the past week, what is happening in our country and in our state and in our hometown of LA, has been absolutely devastating," Markle said.
"I wasn't sure what I could say to you. I wanted to say the right thing. I was really nervous that I wouldn't, or that it would get picked apart and I realized the only wrong thing is to say nothing," she said. "Because George Floyd's life mattered and Breonna Taylor's life mattered and Philando Castile's life mattered and Tamir Rice's life mattered. And so did so many other people whose names we know and whose names we do not know."
Markle shared a message from one of her high school teachers that has stuck with her throughout the years.
"Always remember to put others' needs above your own fears,'" she said.
Markle also recalled her experience with the 1992 Los Angeles riots, which she said occurred after "another senseless act of racism" -- four LAPD officers being acquitted for the arrest and beating of Rodney King.
"I remember the curfew and I remember rushing back home, and on that drive home seeing ash fall from the sky," Markle said. "I remember seeing men in the back of a van holding guns and rifles, and I remember pulling up to the house and seeing the tree that had always been there completely charred. Those memories don't go away."
"I am sorry that, in a way, we have not gotten the world to a place that you deserve it to be," she added.
Markle called on the new graduates to help create change by leading with love and compassion and using their voices.
"We are seeing people stand in solidarity, we are seeing communities come together and to uplift. And you are going to be part of this," the duchess said.
"I know sometimes people say, 'How many times do we need to rebuild?' Well, you know what? We are going to rebuild and rebuild and rebuild until it is rebuilt. Because when the foundation is broken, so are we," she said.
Markle, who is biracial, was subject to increased racist and sexist abuse after her relationship with Prince Harry became public. Harry spoke out in 2016, saying the treatment of Markle crossed a line.
Markle and Harry married in May 2018 and have a 13-month-old son, Archie. The couple presently live in Los Angeles.