How do i break the habit of baby sleeping on the boob

Mo

He is 7, months now. I do try to rock him (which I know is also a bad idea) n not give him boob. He cries and sleeps after. But in the middle of the night, am too sleepy to do that so I give boob n we both get the much needed rest. But I am slowly thinking he is getting to a stage where I will be judged if I don't train him.