The adjective famous describes someone or something that a lot of people know about.
Does infamous mean the opposite, “not famous”? No! Infamous means being famous for a BAD reason. For example, a criminal who has robbed 10 big banks would be an infamous bank robber – a lot of people know about him, but it’s because of something negative, because of his bad behavior.
A person is infamous when they have a very bad reputation that is known by a lot of people. We can also use this word for things that are not people.
If there’s a city that has terrible traffic all the time, we can talk about the infamous traffic jams there – again, well-known for a bad reason.