Hardly =barely; scarcely; almost not: ‘It was hardly raining at all.’ ‘I could hardly believe my eyes.’
Hard= (1) with a lot of effort: ‘If you study hard, you will secure good marks in the examination.’ (2) Heavily or severely: ‘The authorities are coming down hard on tax evasion.’
Before a past participle, use severely for this meaning: ‘If they are caught, they will be severely punished.’