Dear Anastasia, most of the time there is no difference, they are synonyms. When you have something to do and you don't think it will be easy then the task is hard or difficult. However, we often tend to use difficult for something that is complicated, but hard for physically challenging things.
👉This puzzle was difficult.
👉Cleaning the oven was hard.
I hope that helps! 😃✌