[noun] + と同じで [noun] + と違って
[noun] + と同じように [noun] + と違い
Note: と同じで emphasizes shared quality; と同じように emphasizes manner. Note: と違い is a more formal/written variant of と違って.
The expressions と同じで and と違って are used to compare two things by stating that something is similar to or different from something else. They set up a comparison at the beginning of a clause, with the rest of the sentence describing what is similar or different.
と同じで indicates that something shares a quality or characteristic with something else. It connects to the following clause to explain what is the same.
You can also use と同じように for a similar meaning, emphasizing the manner in which something is the same. とおなじ同じで focuses more on stating the shared attribute, while とおなじよう同じように emphasizes doing something in the same way.
と違って indicates that something contrasts with or differs from something else. The rest of the sentence describes how it is different.