In many cases, hard and difficult mean the same thing. For instance a hard/difficult job, a hard/difficult subject in school. English has 10,000 examples of what are called near synonyms such as these. They are words that usually mean the same thing in some contexts but different is other contexts or to different extents.
Here are a few exceptions:
When you're talking about something you can physically touch and it is rigid. It is only hard.
If you call a person hard or difficult they mean 2 different things. A hard person would be a person who has been toughened by life experiences. A difficult person is someone who is not easy to be around or to work with.
Difficult was introduced into English from French as a synonym for hard. It has evolved a slightly different meaning. We usually say hard in English, but difficult is not at all uncommon.