These two words are homophones. Homophones are words that have the same pronunciation but have a different meaning.
“Heard” is the verb to hear in the past.
“Herd” refers to a group of animals of the same species that stay together. For example a herd of cows.