Mohammed Hussain, 18, of Elizabeth Square, Preston, was found to have 34 wraps of heroin and nine of cocaine during a strip search.
Preston Crown Court heard he became addicted to Xanax and cannabis aged just 17 and agreed to deal heroin and crack to pay off a debt and get more drugs.
He admitted possession of heroin and crack with intent to supply them on September 13, 2020.
Thunderstorms and heavy downpours of rain predicted to hit Lancashire as Met Office issues yellow weather warning
Man killed in late night crash on A6 Chorley Road near Blackrod
M6, M61 and M55 delays in Preston due to Blackpool Air Show and Lake District holiday traffic
Video shows man in van wielding weapon in Preston city centre fight
Preston man remains in a critical condition as Lancashire Police appeal for witnesses
Peter Barr, prosecuting, said police had become suspicious of a silver car parked at an angle in Preston and during a search found a machete and a phone.
He added: "Ultimately the defendant was apprehended, arrested and taken to the police station.
"He was strip searched and there were wraps of heroin and cocaine found.
"No incriminating texts were found on his mobile phone but police say the number of wraps indicated possession with intent to supply.
The court heard Hussain, who now works with his dad in the catering industry and also for DPD, claimed it was the first time he had been out doing it.
Defending, Daniel Harman said: "These offences now go back 12 months to when he was 18, he had no relevant previous convictions.
"The pre sentence report paints a picture of a young man who has knocked his long term addiction on its head.
"He has certainly had to placate his parents as much as anyone else going forwards. They are supporting him with a firm hand on the tiller.
"Unfortunately he can't get back the time he's lost...what he can do is try to be a productive adult."
Suspending his 21 month jail term for two years, Judge Simon Medland QC said: "You are a young man who obviously has considerable promise for the future.
"You are at the moment industrious, earning money and leading a quiet life with your family.
"From everything I know I'm quite certain your father and your family are deeply embarrassed about you behaving in a way they would never even contemplate.
"You were a much younger man at the time and are described as being immature.
"Nobody could complain if I imposed an immediate sentence of custody at this juncture because as you know now, class A drugs destroy people's lives, and you were part of that trade at the time... helping to perpetuate that cycle of despair.
In addition Hussain got a rehabilitation requirement, 100 hours of unpaid work and must pay £500 costs.
The Lancashire Post is more reliant than ever on you taking out a digital subscription to support our journalism. For unlimited access to Lancashire news and information online, you can subscribe here.