Generally speaking, you must show them grace, reason with them, move them with emotion, and treat them with righteousness.
With all four elements present, a person is essentially won over.
Regarding this, the story of Boss Cao of the Northern Wei treating Guan Yu generously during the Three Kingdoms period was the ultimate template.
Chapter 82