Without more information, it's difficult to know what you're doing wrong. From your error message, I'd guess that you are trying to create identical values for a column that is marked as the primary key. Primary keys must be unique.
The error means exactly what it says. You have some column or group of columns that you've defined as unique. So you can't put dupes into them. And you're trying to. How you would fix it is to filter out the duplicates from your insert or update statement that's throwing the error.