At first, it is likely they didn’t know. And as bad as those diseases were for the natives, they were also bad diseases for the explorers. After the first epidemics, then yes, I think they made the connection. But I don’t think it was intentional at first. It’s not as if they brought some sick sailor in their ships solely to spread the disease in the next port.
Only happened mostly in the new world, and they at first probably did not know. Most diseases are incubated between humans and their domesticated animals. Flu for example originates in southeast Asia typically, where migratory bird diseases are dropped into the muck pigs live in; poor farmers very close to the pigs will become the first victims. Similarly, smallpox had a near-relative cowpox, which led to the idea of vaccines. Milkmaids got cowpox and so were immune to smallpox.
As I’ve said on other threads, I read about a study of the smallpox epidemic in northwest Canada and Alaska in the mid-1800’s. The author’s contention is that so many died, not because they were more likely to die, but because in subsistence lifestyle where everyone becomes sick at once, there is nobody to provide food and water; people die of thirst or exposure to the elements, or starving weakened them, so more likely to die. Villages with even one immune (previously exposed) person to tend the others survived much better. this might also explain why the toll does not seem to have been as severe in the tropics, where weather exposure was not as serious a risk.
Of course, the very first exposures were probably not as evident - it’s not like the locals keeled over the moment hey shook hands. The massive abandoned cities of the Ohio valley area never saw de Soto, but supposedly his men (and his pigs, along for the bacon) infected people who passed the disease on until Indians hundreds of miles away died before the white man even saw them.
I assume the explorers noticed the villages they stayed in or near seemed to get epidemics of familiar diseases. However, regular waves of diseases were a common feature of life in Europe too.
There is the urban legend that the US government tried to infect western reserves with smallpox blankets, based on one incident.
This was 1760’s, the Indians there had been hanging around with Europeans for up to 200 years, they likely had about the same level of herd immunity as the settlers. It does show the Europeans were aware the natives could at times be (more?) susceptible to diseases.
In true European fashion, I’m sure the risk of disease was not a strong concern of the settlers.