Hamilton man who sold drugs to a minor jailed