I known of three cases involving decent people who nearly went to jail for crimes they did not commit. You have to be careful who you associate with and let into your circle. In the first case, a young man in his early twenties was in a car with a group of friends. He was just hanging out with his friends as many people do. However, one of his friends, the one driving the car, didn't tell him he was going to make a stop at a post office to pick up something in the mail that he had illegally shipped to him. The government had already intercepted the illegal contents of the package (drugs) and was waiting for him to pick it up at the post office to lock him up. He and everyone in the car, including some of his friends who had done nothing wrong, were arrested. It set off a legal mess their parents had to spend legal fees to get them out of.
Then there's another case of a young man whose friend called him up to go for a ride in his new car. He didn't bother to tell the young man the car was stolen. He picked him and other friends up for a ride in his new car. Police stopped them and ordered them out of the stolen car. Two ran and got away (for a time) including the boy who had stolen the car. However, two were caught. Both of them were innocent. Their parents had to pay legal fees to sort the mess out and free them.
In a second case, a girl fell in love with a guy. While on a date with her on the beach, he decided to rob a tourist. The robbery went wrong, a struggle ensued and he ended up killing the tourist. He was arrested and so was his innocent girlfriend, who was freaked out and in shock by what he had just done. Though she had nothing to do with the crime, the police arrested him and his girlfriend as well, which is standard in serious cases to ensure no one gets away. Her parent had to get a lawyer to get her out of legal charges, to prove she had done nothing wrong. She was later freed.
These situations can happen to anyone. Be careful of getting into situations that are seemingly innocent, but can bring you harm and disrepute, for things you have not done. It's not always easy to tell as some situations seem innocuous on the surface, nonetheless, be careful. Being at the wrong place at the wrong time has gotten many innocent people into trouble. There are people currently in jail affirming they are innocent of the crimes they were incarcerated for, but no one will listen. However, if you are locked up for a crime you did not commit, do not give up on having your conviction overturned. DNA and later discredited witnesses have been successfully cited in cases freeing innocent people.