If you're interested in doing a postdoc after your PhD, it's a good idea to start exploring potential opportunities and contacting PIs about a year before you plan to graduate from your PhD program. This will give you enough time to identify potential postdoc positions, network with potential mentors, and submit applications before you complete your degree. You can look online for postdoc job listings on websites such as academicjobsonline.org, ScienceCareers.org, and LinkedIn.