It depends on the giver and the gift.
If it's from someone who shouldn't be giving me a particular gift (say, an acquaintance giving me something expensive, or a guy I've got in the Friend Zone giving me lingerie) I would politely decline saying I don't feel comfortable accepting such a gift based on our current relationship
, and would thank them for the thought.
If it was a gift I did not want because I felt it was inappropriate or in poor taste, I would privately talk to the giver and explain my feelings.
If it was something I just didn't want because I didn't like it, I would thank the giver sincerely for their thoughtfulness and do so with as much grace as possible. I would then put the item in the back of the closet.