Assalaamu Alaikum,
Certainly what we experience in childhood does shape us in many ways but it certainly does not hav to define us and we do not have to continue to be that way. We can overcome the evils we were exposed to. It is our Nafs (desires) that seeks for us to continue the way we are because it wants us to remain in our "comfort zone". It also seeks for us to be in a constant state of "pleasure" in terms of getting endorphins from our addictions whether good or bad, which is why we continue with our addictions.
However we can certainly change and adapt our comfort zone of bad addictions to that of good habits. It takes a lot of self determination, persistence and consistency and a period of discomfort but eventually we will become accustomed to whatever good habits we continue to practice. It is said that to gain a good habit takes at least 21 days and some say uoro 60. But if we push through then eventually we can replace our bad addictions with good ones.
Almighty Allah has given everyone of us the capacity to change. Change is certainly not easy but it is absolutely possible for everyone of us. However what I would say is that if we have trauma in our childhood then I would urge that we seek therapy/counseling preferably from a Muslim therapist/counselor. Face to face is obviously better but nowadays it can be done online over video call.
The following are just a few general ways we can help ourselves to change a bad habit:
1. Quit caffeine. This maybe surprising for many but caffeine is a highly addictive substance. You only need one cup a day to be addicted. If you don't think you are then go without it for 3 days and you will realise. Caffeine causes one to become weaker to other addictions as it plays with the bodies hormonal and adrenal system. Some are more sensitive to it than others but you will certainly find that quitting caffeine will help you to quit other addictions and increase you in will power as well as clearing one's mind as consistent caffeine use can cause brain fog and loss of focus. Quitting helps one to become more stable minded and calmer and less agitated, fatigued and short tempered. Most importantly It allows one to have a much better and deeper sleep as caffeine affects sleep, even if you've only had one in the morning. Caffeine does not increase focus and productivity in the long term. It hampers it. Allah created us perfectly without the need of external substances to help us operate optimumly on a daily basis. So try quitting for 30 days and you will see the benefits in every aspect of your life. This also includes other addictive drugs such as nicotine and even prescribed drugs such as opioids.
2. Correct sleep pattern. It goes without saying that the most important thing we can do for our health is to correct our sleep pattern. This effects every aspect of our mind, body and soul. If our sleep pattern is not consistent then it will have a detrimental affect in every aspect of our lives including our Deen. We can never be the best versions of ourselves if we do not correct our sleep patterns. Therefore we must sleep early and awaken early. The earlier we sleep the less time we will have in the evenings for our desires to become ignited.
3. Eat smaller portions of food, reduce red meat and Fast. Eating large portions of food has a hugely detrimental effect on our health as well as our desires. Reduce food portion sizes, reduce red meat to once a fortnight and fast the Sunnah days twice a week on Monday and Thursdays as well as the 3 white days (13th, 14th and 15th of each Islamic month) and you will reap the rewards and benefits to your health in terms of mental, physical and spiritual well-being. It will also help significantly to control one's desires and increase in will power.
4. Quit TV, movies/Dramas, control internet usage. It goes without saying that Television, movies, dramas etc are significantly detrimental to our conscious and subconscious minds. This is because most of what is showed is opposite to what our Deen conveys and propagates. It is full of propaganda and indoctrination both directly and subconsciously. If we cannot totally quit then at least be very selective in terms of what we feed our minds and always appoint specific times that we will watch certain programmes and be on the internet. Try to avoid totally from 8pm onwards as the desires weaken as the evening sets in. If we don't schedule our time then we will just browse and watch without measure and that is what is likely to ignite passions and desires. Put a internet block on adult websites and hide password somewhere so it is an effort to find it.
5. Occupy yourself with good things in the evenings. Feed your mind Islamic knowledge and schedule remembrance of Allah and pondering over Allah from 8 pm onwards so you spend the evening occupied with good so that evil and desires cannot set in. Read, read and read. Reading has declined significantly in our times only to our detriment. Schedule in to read a minimum of one page of a good Islamic book and one page of the Qur'an with it's meanings. Start off small and gradually increase.
6. Organise and schedule your time. This is very important in order to be more selective about how we spend our time. If we don't schedule and organise our precious time then shaythan and our Nafs certainly will. You can use many tools nowadays to schedule time whether on outlook, phone apps or on paper. Whatever works best for you.
7. Pray Tahajjud. This has a profound effect on one's overall level of Imaan. Awaken even 15-20 minutes before Fajr begins and Pray 2 - 8 Rakah whatever you can manage. Afterwards connect with Allah through Dua. Ask of him and beg of him to help you in every aspect of your life especially when it comes to overcoming detrimental addictions. The amazing thing about Tahajjud is that you will continue to feel that special feeling throughout the day and you will feel your imaan on a high. You will be more inclined to do good deeds and less inclined towards sin. Try it and you will see! However to enhance this special feeling ensure that men in particular try and pray Fajr with congregation. Connecting to the Masjid is essentially connecting with Allah and has a hugely positive effect on helping keep us at bay with our desires and also connect with other Muslims.
I hope the above tips help. May Allah enable us to overcome all habits and addictions that are holding us back from getting closer to him and being the best versions of ourselves. Ameen