When a hard inquiry is put on your credit report the hard inquiry stays on your credit report for a period of 2 years and then after 2 years the hard inquiry is automatically removed without you needing to do anything.
However hard inquiries only impact your credit score for a period of one year and after the year the hard inquiry will not impact your credit score.