Why do cyanide and arsenic smell like almonds and garlic, respectively?
According to CDC.gov and Toxnet, bitter almonds contain cyanide, which, gives them the characteristic odor, but this can be also due to benzaldehyde (PubChem), which is, by the way, used as almond flavor for cooking (Wikipedia).

Garlic has its odor due to allyl methyl sulfide (Wikipedia) and not due to arsenic, which is not present in garlic in significant amounts. Arsenic as such does not have garlic odor and foods high in arsenic, such as rice, chicken, fish, beer and wine (Prevention) do not smell like garlic.

However, poisoning by toxins, such as arsenic, thallium, organophosphate pesticides, selenium and tellurium (FPNotebook, PubMed) is followed by addition of the methyl group (CH3) to them by normal intestinal bacteria, which gives them the garlic-like odor.

So, the connection between the garlic odor of garlic and arsenic (or other) poisoning is in the presence of methylated substances: allyl methyl sulfide in garlic, trimethylarsine in arsenic poisoning, dimethylselenide in selenium poisoning, etc (PubMed).