To change behavior, there are some important aspects that you need to be consistent with. "Do what you say, say what you do". Follow through is important! When you say No, it should stick to No. If he is having a meltdown, you can jump in to block from injury, but give no attention to the behavior. Wait for child to calm down.
Offer alternatives and choices to your child, that is almost/equal to his favorite. Consider something that he likes and the value is worth from what he wants previously. "We can't have the train set, but we can have ice cream instead". If he refuses, make it clear that the deal is off. Follow through!
Also, remember to catch the good behavior! If you want to give what he wants, use this chance to reward them. For example, "You have been listening so well! Lets go get you a train set!"
p/s: besides screaming at your child for their inappropriate behavior, remember to acknowledge their good behavior when it comes out spontaneously too!