Find Travel Requirements
You'll need to know the time window your destination country is requiring a test within, and also whether that time window starts at departure or arrival.
Find Which Day You Need to Test
Take the time of your departure or arrival, and subtract the time window for testing. The date and time you arrive on is the start of your testing window.
Schedule an Appointment
Test as soon as possible from the start of your testing window. Verify the estimated turnaround time for your test is before you depart.