The children of Adam (AS) who followed after him were good and righteous people, who worshipped Allah in the correct way. But Shaitaan did not like this. Remember, he wanted to lead as many humans away from the path of Allah as possible, because he was still bitter and jealous about Adam (AS). And so he came up with a plan.
There were many good people in the next few generations after Adam (AS). When they died, Shaitaan came to the rest of the people in disguise and suggested that they build statues of these good people to remember them and their righteousness. The people agreed, and eventually even brought these statues into their houses.
Their children grew up seeing the respect that their parents had for these statues every day. So later on when they were older, Shaitaan came to them and advised them to start worshipping these statues directly, and he lied that doing this would please Allah.
Their children then grew up learning to worship these idols and eventually, by the time that Nuh (AS) came, people had forgotten why they were even worshipping them in the first place. The prophet Muhammad (SAW) told us that Nuh (AS) was 10 generations after Adam (AS), so this was a very long time.
Shaitaan works gradually. Here his plan even took hundreds of years to enact! In our lives, he may slowly lead us onto the wrong path by tempting us with something that seems good at first but will actually lead to something that angers Allah. He especially likes to twist the way that people worship Allah until it becomes bad, and this is called innovation (bidah). When people first created statues of these righteous men, they did it to remember how good they were so they would remember to worship Allah. But their children ended up worshipping the statues themselves and this was shirk and a major sin.
<a href='https://www.freepik.com/vectors/abstract'>Abstract vector created by starline - www.freepik.com</a>