1. Hard can be an adjective or an adverb
- It’s a hard job (adjective)
- This is very hard bread (adjective)
- You have to word hard. (adverb)
(not You have to work hardly)
- Hit it hard. (adverb)
2. Hardly in an adverb. It means ‘almost no’ or ‘almost not’
- He hardly works at all (= He does very little work)
- I’ve got hardly any money.
- He knows hardly anything about geography.
Note that hardly, hardly any, hardly ever etc are much more common than almost not, almost no, almost never etc