Trial by media can be defined as the act when the public media or a country presents a case in an opinionated manner and passes judgments according to it. Such judgments do not have any legal validity, however, since media has such a large influence over the general public, trials by media can have massive social impacts. I feel trial by the media is more of an intervention than a necessity.
The crux of the problem lies in the fact that such media judgments do not have any legal validity. Every country has a working legal structure established in place, which involves highly educated judges, lawyers and litigators and the system is aptly supported by the government. Any particular individual or entity does not have the right to pass judgment on the actions of other people.
Media, however, is an interesting case. The media of a country has a massive reach and is really influential in forming the public opinion. As such, any wrong judgment by the media can glorify a wrongful or demonize a righteous person even before the legal court judgment is out.
An example of this would be an incident in 2016 when two girls claimed to be molested by a couple of young men. Even before the case reached the court, the media had already started demonizing the boys as rapists. Finally, when the judgment came out, it was found that the boys were innocent and that the girls were lying. The intervention by the media did nothing to help the boys. In fact, it tarnished their reputation a lot.
However, there is a counter argument to this line of thinking. Our legal system is incredibly slow. It takes years at end for any given case to reach a conclusion. As such, an opinionated approach by the media can influence the masses to appeal to the courts to bring quicker justice.
Hence, in the end, it can be said that trial by media is more often than not an intervention than a necessity and should be kept in check.