< It's (= It is) ~ to ... > で 「...するのは~だ」 という意味です。
It's difficult to concentrate when you're sleepy. (眠いときに集中するのは難しい)
I wish I could ~ で 「(実際には無理だけれど)~できたらいいなあ」という意味です。
I wish I could join you, but I have a test tomorrow. (あなたと一緒に行きたいけれど、明日テストがあるからだめなの)