They are often confused, aren’t they? People sell products with bonuses that “compliment” the main product, though it’s difficult to know how that is actually achieved.
The two words are pronounced the same, but they have quite different meanings. One is used when you wish to say nice things to someone else, and the other is used when you wish to say that one thing goes well with another thing. Which is which?
Compliment, the word spelled with an “i”, means the nice things you might say to someone else. An example could be, “He gave her an unexpected compliment by telling her she looked at least 10 years younger”.
Complement, the word spelled with an “e”, means that something goes well with something else. An example could be, “The dessert was a delightful complement to the main meal”.
So now you know. You have no further excuse for mixing them up.