There are several different kinds of perjury, but the most common kind deals with lying under oath. If you're lawfully placed under oath and willfully make a false statement about a material fact, you can be charged and convicted of perjury. If you're convicted of perjury you will never be able to serve as a juror and you will never be able to hold an office of trust under the Constitution of Virginia.
Being placed under oath usually means that you raise your right arm and swear to tell the truth. That most often happens in a court during a trial, but it can happen in other instances. If you report a crime to the police and they take you in front of a magistrate, you will probably be placed under oath before making a statement to the magistrate.
Perjury is different from making a false statement to a police officer. That is a separate offense.
A material fact is a relevant and important fact. A material fact would be a fact that could make a significant difference in a case. A material fact in a murder case would be whether the victim had a gun drawn at the time of the shooting. A non-material fact would be something like whether the victim was wearing dark blue shoes or black shoes.
In almost every case, witnesses testify inconsistently. Sometimes they will testify at a preliminary hearing that you were 10 feet away from the car. But then at trial, they will testify that you were 15 feet away. In most cases, those kinds of inconsistencies would not be perjury. A defense could make use of inconsistencies to argue that the witness should not be trusted, but those kinds of inconsistencies would not rise to the level of perjury.
To be convicted of perjury, you have to willfully make a false statement. Willfully means that you know the statement you're making is false. This is the hardest element for the prosecution to prove. Many people make mistakes when they are relying on their memory. It can be very difficult to prove that someone willfully made a false statement as opposed to a mistake.
Perjury is a class 5 felony. That means it's punishable by up to 10 years in prison. In most cases, you do not need to worry about getting 10 years.