This phrase often implies criticism or disapproval in someone's actions or behavior, making it unpleasant. He's been giving Sally a hard time about her driving skills.
Pro Tip 2/3
Emotional Impact
Using this phrase can reveal frustration or annoyance towards the person creating the difficulty. After the error, the team really gave the goalkeeper a hard time.
Pro Tip 3/3
Not Literal
The phrase doesn't mean physical difficulty but refers to any obstacle or pressure someone faces. His strict parents always give him a hard time about his grades.