In contrast with the other answer I want to say that to translate "It was dark" first you need to be specific about what "it was" refers to.
"it was" could be a place or it could be a time, then you could be talking about a permanent condition or about a temporary one, and as you already understand one option will call for the use of ser and the other for the use of estar
You could be talking about a place that is always dark and say "era ̶u̶n̶ ̶s̶i̶t̶i̶o̶ oscuro" but you can omit "un sitio" and leave it implicit, specially in narration. era oscuro
Or, you could be talking about a place that is not usually dark but it was at that time. "la casa estaba oscura y ..."
So in conclusión, you should use "estaba" if you are talking about the state of a place at a given time but you should use "era" if you are talking about the permanent state of a place or if you are talking about a time when "it was" dark.
Examples of it was :
- as a time/moment:
- Era una noche oscura y no pude ver su cara = It was a dark night and I could not see his face
- Era miércoles = It was wednesday.
- as a temporary state:
- Entramos a la casa y estaba oscura y... = We enter the house and it was dark and...
- as a permanent state:
- Entramos a la cueva y era oscura por lo que .... = We enter the cave and it was dark so I could not ..
"oscuro" could be temporary or permanent condition so you should pick the ser or estar verbs accordingly.