Well, だった is simply the past tense form of だ.
It was pretty.
で can get a little bit more complicated when you start to describe all the cases it can be used, but it's basically just the TE-form of だ. So, if you wanted to combine two sentences, for example "I went to the store" and "I bought some food", it would become "スーパーへ行って、食べ物を買いました。" You put the verb 行く into TE-form, and add on the next sentence. So, if your first sentence ended with だ, you would do the same thing.
I am a student, and I am studying math.
Also, the negative form of だ technically uses the TE-form as well.
で+は+ない ＝＞ ではない ＝＞ じゃない
Or is also used in the word である. Which is basically another way of saying だ, but that's another topic for another time.
As for に I think you're referring to something like きれいに or 静かに where these words would normally be followed by な, correct?
You can think of this as simply turning the adjective into an adverb.
This is a quiet room.
Please be quiet in this room.