Does Paul in 2 Corinthians 6:14 contradict Jesus in Mark 2:17? When Paul says:
"Don’t become partners with those who do not believe. For what partnership is there between righteousness and lawlessness? Or what fellowship does light have with darkness?  What agreement does Christ have with Belial? Or what does a believer have in common with an unbeliever? And what agreement does the temple of God have with idols? For we are the temple of the living God, as God said:  I will dwell   and walk among them,  and I will be their God,   and they will be my people.     Therefore, come out from among them  and be separate, says the Lord;  do not touch any unclean thing,  and I will welcome you.
2 Corinthians 6:14‭-‬17 CSB"

Does it mean to not be friends with unbelievers? If yes, doesn't it contradict Jesus in Mark 2 when He was eating and drinking with sinners?
Paul means do not be in a relationship with unbelievers such as marriage, business, or other situations where there would be pressure to compromise.  That is different from being friends with unbelievers with a view to win them to Christ.  Jesus himself quoted the Pharisees saying in Matthew 11:19 "The Son of Man came eating and drinking, and they say, ‘Look at him! A glutton and a drunkard, a friend of tax collectors and sinners."