How can you know if the individual you will have intercourse with has the infection and that you may become infected?

You cannot always know. There is certainty only if this person has genital warts at the moment.

They may also have been infected in the past and carry HPV in their cells.