[noun] + と同じで、[sentence] [noun] + と違って、[sentence] [noun] + と違い、[sentence]
と同じで means "like", "the same as", and と違って means "unlike", "different from". Both follow the noun you are comparing with, and the clause after them says what is the same or what is different.
The two come from the て-forms of おなじ同じだ and ちがう違う, so the comma after them joins two clauses. What follows と同じで usually carries も, because the second thing shares the quality with the first.
These go beyond the two basic forms.
Adding は gives とはちがって違って, which sharpens the contrast, often against what you expected.