Hi Anastasiya,
1. "-다" format is used for writing and speech.
1) In writing
Ex. When writing a diary,
"오늘은 친구들과 시내에 갔다. 쇼핑도 하고 맛있는 피자도 먹었다. 참 재밌었다."
(=I went to downtown with my friends. We went shopping and had a delicious pizza. It was really fun)
2) In speech, it is considered as "반말"(that people use when talking to a friend or younger person).
2. "-어요" format is used for speech.
It is considered as "존댓말"(that people use when talking to older person).
Ex.
Me: "Did you have a lunch?" (나: 할아버지 점심 드셨어요?) -> 존댓말
Grandfather: "Yes, I just had it." (할아버지: 그래, 방금 먹었다.) -> 반말
--------------------------------------------------------
<Original verb> - <반말> - <존댓말>
졸리다 졸리다 졸려요
쉬다 쉰다 쉬어요
있다 있다 있어요
없다 없다 없어요
--------------------------------------------------------
Hope it helps,