“This statement is not something Jefferson wrote, but rather comes from a passage he included in his “Legal Commonplace Book.” The passage is from Cesare Beccaria’s Essay on Crimes and Punishments, originally published in Italian in 1764.” From the following source:
https://www.monticello.org/site/jefferson/laws-forbid-carrying-armsquotation
Still a great quote and wise of Jefferson to quote it.