McLaggan was shot and killed Friday night in the parking lot of Food Lion on Western Boulevard near NC State.
Anderson was arrested Saturday and is being held in the Wake County Detention Center. Investigators have not released any details about the motive for the killing.
McLaggan, who was from Thomasville, was a former student at NC State who earned his bachelor's degree in agricultural business management in December 2021.
McLaggan's family said he had such a bright future, one that was taken too soon. He is one of three siblings in his family.
A family friend says he lost his mom at a young age, and his dad, Clifford raised McLaggan and his two sisters.
Clifford provided this statement on his son's death:
"He was vibrant and had all these credentials and looking forward to working in the field of agricultural business. We miss him so much and we are very upset that we won't be able to see the fruits of his labor. Cody was the sweetest and most humble person you could have met, and he treated everyone with the upmost care. Constantly putting others before himself and never judging anyone for who they were."
Lilly Covington and her brother grew up with McLaggan and his two sisters in Davidson County.
"He loved putting other people first. It's just that was one of his amazing qualities. He is so funny he would not leave a room until he made you laugh." said Covington.
She started a GoFundMe to help the family pay for funeral expenses.
"I just want to do everything I can to bless them and take the stress of what just happened last night off of their shoulders and help them not worry and stress about that at all," Covington added.
Covington says one of the hardest parts of this tragedy is McLaggan was excited to start his new career after just graduating from NC State in December.
"He just accepted a job in Virginia for agricultural business and he was getting ready to pack his things and move. We were so excited to see his opportunities that he would have as a you know, a recent graduate and start his adult life, you know, and he had so many opportunities and then it's just been taken from them and it's just so sad," Covington said.
Anderson will make a first court appearance at 2 p.m. Monday.