How does the media influence the people (general public) to be with or against something?
The mass media can influence to be for or against something because it is the main way in which we find out about anything that is going on in our world. The way that the media presents topics to us is the main way in which we come to know anything about those topics. Naturally, then, the media can have some influence on how we perceive things even if it cannot completely determine what we think.
Most people know absolutely nothing about most issues and events other than what they hear or see in the media. Therefore, the media can create images and attitudes in our minds with respect to those issues and attitudes. For example, let us look at the case of Edward Snowden, who leaked the information about the NSA surveillance program in the United States. I know nothing about him but what I have read in the media. Therefore, my attitudes towards him are heavily colored by what I have read.
This does not mean that the media can completely force us to think about things in a given way. For one thing, media outlets sometimes publicize different angles on a given story. We then have to think for ourselves to determine which angle will be most compelling to us. For another thing, we will already have preconceived ideas about things that will prevent the media from completely determining how we think. For example, if people are already disposed to distrust the US government, they might think Snowden is a hero regardless of what the media says.
Because we get most of our information through the media, the media has a significant ability to shape our attitudes.