The testing requirements are spelled out in 14 CFR §61.183(d)(e)(f), which require you to received a logbook endorsement from an authorized instructor to take the fundamentals of instruction knowledge exam. These requirements can be waived if you are currently employed as a teacher in junior high or high school or are a college professor. The only other requirement is that you pass an aeronautical knowledge exam appropriate to the category and class of aircraft you are applying for on a flight instructor’s certificate.
(d) Receive a logbook endorsement from an authorized instructor on the fundamentals of instructing listed in §61.185 of this part appropriate to the required knowledge test;
(e) Pass a knowledge test on the areas listed in §61.185(a)(1) of this part, unless the applicant:
(1) Holds a flight instructor certificate or ground instructor certificate issued under this part;
(2) Holds a teacher’s certificate issued by a State, county, city, or municipality that authorizes the person to teach at an educational level of the 7th grade or higher; or
(3) Is employed as a teacher at an accredited college or university.
(f) Pass a knowledge test on the aeronautical knowledge areas listed in §61.185(a)(2) and (a)(3) of this part that are appropriate to the flight instructor rating sought;
As to specific preparation for the flight instructor aeronautical knowledge exam, there is no special requirement for this and It does not require a formal ground school or home study course nor an instructor endorsement to take it. You will be required to receive an instructor sign off to take the fundamentals of instruction exam, and a formal study course is recommended as preparation for this.
I’d also recommend a formal ground school with experienced instructors for preparation to obtain an instructor rating. Having the knowledge of how to fly and airplane is one thing. Being able to teach another person how to fly is an entirely different animal. Some formative tutelage by an experienced instructor on all the knowledge and practical nuances required for an instructor certificate can go a long way. The FI and CFI airplane knowledge exams aren’t bad, but the CFI practical test is going to be pretty grueling. Mine was 10 hours long - 7.5 oral, 2.5 flying - and probably the most difficult exam I ever had in my life.