You don't have to "book" anything. You can just buy a ticket and hop on the next train.
If you buy (well) in advance you can get discounted tickets. However on this route they are not that much cheaper than the standard fare tickets.
If you plan a day trip to Würzburg the cheapest option is to use regional trains and buy 2 tickets.
1. RMV day ticket from Frankfurt to Kahl which is EUR 14,25
2. Bayern Ticket which is EUR 22 for 1 person
Bayern Ticket covers all regional trains in Bavaria. Kahl is the first stop inside Bavaria. Bayern Ticket covers furthermore also the trams and buses in Würzburg. Bayern Ticket is valid
Mo-Fr: from 9am till 3am next day
Sa,Su: from midnight till 3am next day
You don't have to do anything in Kahl. Just stay seated.
You can buy both tickets from ticket machines in Frankfurt.