Convince another of one's merits, present oneself in a favorable light, as in A job interview is an ideal opportunity to sell oneself to a prospective employer. Originally this idiom, dating from the second half of the 1700s, alluded to selling one's services for money, but it was being used more loosely by the mid-1800s.
Compromise one's principles for monetary gain. An early version was sell oneself (or one's soul) to the devil, which alluded to enlisting the devil's help in exchange for one's soul after death. It is embodied in the legend of Faust, first recorded in the late 1500s.