Take into consideration that an affair is a dangerous thing, not only in acting it out but also in preparation for one.
An affair is basically, against all the mores and religious teaching of probably all the world's religions. In most countries it is also against the law.
There are no set fast rules for how to have an affair. There may be a limited number of guidebooks and websites which tend to call themselves the definitive guide to having an affair, but ultimately it's up to you to determine how and if you're going to emabark on this dangerous path.
Before beginning an affair make certain that you are sure that you can and will be able to survive the consequences of discovery. Your affair may be discovered immediately or .....perhaps twenty years down the road. You may have forgotten about it but somewhere, somehow it came to light. Now your comfortable life is in jeopardy of disintegration because of something you did decades ago.
Have an affair if that is your thing, but plan carefully and expect to be caught eventually.
The only perfect way to not get caught is to not have an affair.