Leeds Crown Court heard police found class A drugs when they stopped a car being driven by 31-year-old Jermaine Cunningham on Victoria Road, Scarborough, in September 2015.
An investigation was launched which led detectives to 41-year-old Jaime Johnson, who lived in Cross Street, Scarborough at the time of the offences and was helping Cunningham run his drugs business.
Both were charged with conspiracy to supply heroin and crack cocaine.
Cunningham, of Longwood Road, Huddersfield, was also charged with dangerous driving.
Cunningham pleaded guilty while Johnson denied the offence and was convicted after a trial at Leeds Crown Court earlier this monh.
A Leeds Crown Court judge today sentenced Cunningham to seven-and-a-half years in jail and Johnson to three-and-a-half years.
After the hearing, Detective Constable James Temple, who led the case for North Yorkshire Police, said: “During this investigation, we were able to piece together evidence that linked Cunningham and Johnson and uncover a conspiracy to supply dangerous drugs in the Scarborough area.
“It’s devastating to see the damage caused by heroin and cocaine – they rot communities and they ruin people’s lives.
“Criminals like Cunningham and Johnson don’t care about that, but we do. So I’m glad that today’s sentences reflect the severity of the offences they committed and take them off our streets."