Both these passages are long, but it seems like they are speaking of almost the same issues. Notice Sodom and Gomorrah are both mentioned.
2 Peter 2:1-19 (ESV)
1 But false prophets also arose among the people, just as there will be false teachers among you, who will secretly bring in destructive heresies, even denying the Master who bought them, bringing upon themselves swift destruction.
2 And many will follow their sensuality, and because of them the way of truth will be blasphemed.
3 And in their greed they will exploit you with false words. Their condemnation from long ago is not idle, and their destruction is not asleep.
4 For if God did not spare angels when they sinned, but cast them into hell and committed them to chains of gloomy darkness to be kept until the judgment;
5 if he did not spare the ancient world, but preserved Noah, a herald of righteousness, with seven others, when he brought a flood upon the world of the ungodly;
6 if by turning the cities of Sodom and Gomorrah to ashes he condemned them to extinction, making them an example of what is going to happen to the ungodly;
7 and if he rescued righteous Lot, greatly distressed by the sensual conduct of the wicked
8 (for as that righteous man lived among them day after day, he was tormenting his righteous soul over their lawless deeds that he saw and heard);
9 then the Lord knows how to rescue the godly from trials, and to keep the unrighteous under punishment until the day of judgment,
10 and especially those who indulge in the lust of defiling passion and despise authority. Bold and willful, they do not tremble as they blaspheme the glorious ones,
11 whereas angels, though greater in might and power, do not pronounce a blasphemous judgment against them before the Lord.
12 But these, like irrational animals, creatures of instinct, born to be caught and destroyed, blaspheming about matters of which they are ignorant, will also be destroyed in their destruction,
13 suffering wrong as the wage for their wrongdoing. They count it pleasure to revel in the daytime. They are blots and blemishes, reveling in their deceptions, while they feast with you.
14 They have eyes full of adultery, insatiable for sin. They entice unsteady souls. They have hearts trained in greed. Accursed children!
15 Forsaking the right way, they have gone astray. They have followed the way of Balaam, the son of Beor, who loved gain from wrongdoing,
16 but was rebuked for his own transgression; a speechless donkey spoke with human voice and restrained the prophet’s madness.
17 These are waterless springs and mists driven by a storm. For them the gloom of utter darkness has been reserved.
18 For, speaking loud boasts of folly, they entice by sensual passions of the flesh those who are barely escaping from those who live in error.
19 They promise them freedom, but they themselves are slaves of corruption. For whatever overcomes a person, to that he is enslaved.
Compare that to this passage in Jude.
Jude 1:4-16 (ESV)
4 For certain people have crept in unnoticed who long ago were designated for this condemnation, ungodly people, who pervert the grace of our God into sensuality and deny our only Master and Lord, Jesus Christ.
5 Now I want to remind you, although you once fully knew it, that Jesus, who saved a people out of the land of Egypt, afterward destroyed those who did not believe.
6 And the angels who did not stay within their own position of authority, but left their proper dwelling, he has kept in eternal chains under gloomy darkness until the judgment of the great day—
7 just as Sodom and Gomorrah and the surrounding cities, which likewise indulged in sexual immorality and pursued unnatural desire, serve as an example by undergoing a punishment of eternal fire.
8 Yet in like manner these people also, relying on their dreams, defile the flesh, reject authority, and blaspheme the glorious ones.
9 But when the archangel Michael, contending with the devil, was disputing about the body of Moses, he did not presume to pronounce a blasphemous judgment, but said, “The Lord rebuke you.”
10 But these people blaspheme all that they do not understand, and they are destroyed by all that they, like unreasoning animals, understand instinctively.
11 Woe to them! For they walked in the way of Cain and abandoned themselves for the sake of gain to Balaam’s error and perished in Korah’s rebellion.
12 These are hidden reefs at your love feasts, as they feast with you without fear, shepherds feeding themselves; waterless clouds, swept along by winds; fruitless trees in late autumn, twice dead, uprooted;
13 wild waves of the sea, casting up the foam of their own shame; wandering stars, for whom the gloom of utter darkness has been reserved forever.
14 It was also about these that Enoch, the seventh from Adam, prophesied, saying, “Behold, the Lord comes with ten thousands of his holy ones,
15 to execute judgment on all and to convict all the ungodly of all their deeds of ungodliness that they have committed in such an ungodly way, and of all the harsh things that ungodly sinners have spoken against him.”
16 These are grumblers, malcontents, following their own sinful desires; they are loud-mouthed boasters, showing favoritism to gain advantage.
How might these passages affect your understanding of Sodom when referred to in the Scripture?