猪 is read zhū and means “pig”; 赌 is read dǔ and means “to gamble.” They look almost the same, but they sound different and mean different things. In the HSK they first show up as 猪 as a word on its own (HSK 3) and 赌 as a word on its own (HSK 6).
猪 pig
赌 to gamble
An HSK 6 group: Both characters already appear in that level’s vocabulary.
Practice them in Wanyu: the “Look-alike characters” game alternates seeing them and telling them apart. Free.