Gerhard Smith, from Cannock Road, in Wolverhampton, was sentenced at Stoke-on-Trent Crown Court on Thursday to 27 months behind bars.
Smith had pleaded guilty to possession with intent to supply class A drugs, namely crack cocaine and heroin, at an earlier hearing.
He was also ordered to pay a surcharge of £190.
The court heard how officers stopped Smith on London Road in Newcastle-under-Lyme at around 1.15pm on March 7, 2022.
Officers seized a mobile phone, cash and clingfilm, containing class A drugs.
A search of a property off Newcastle Road led to the discovery of additional class A drugs.
DC Philip Pegg, of the Northern Crime Support team at Staffordshire Police, said: "I’m happy that we’ve been able to take these harmful substances out of circulation and stop Smith profiting from the illegal distribution of class A drugs.
“We are proactive in our pursuit of offenders and this is another example of the work we complete on a daily basis to ensure those responsible for dealing drugs in our communities are dealt with robustly.”