I am having difficulty using the Train Line app. Is there a direct train from Basel to Rothburg?
Both Trainline and Deutsche Bahn ( https://int.bahn.de/en ) don't show a "Rothburg". Do you mean "Rothenburg ob der Tauber"? You should use the the DB website above, instead of a third party site. If Rothenburg is your destination, they show 3 transfers (4 trains).
The only direct train to Rothenburg o.d.T is from Steinach bei Rothenburg and it is only about 20 minutes. Rothenburg is at the end of a short, non-electrified, spur line.
To reach Rothenburg you will have 5-7 hours on trains and at least 3 changes unless you catch one of the 2-change train sequences in the wee hours of the morning. Changing trains in Germany is not difficult for most people, generally speaking. It helps to pack your bags according to Rick Steves' instructions:
https://www.ricksteves.com/travel-tips/packing-light/packing-smart
There's a town that shares certain characteristics with Rothenberg - and is much closer to Basel - that can be reached with just one change of train in only 1.5 hours:
https://www.schwarzwaldportal.com/wp-content/uploads/2021/11/IMG_20211014_131531-scaled.jpg
Pay attention to where you want to go.
There is a Rothenburg near Luzern, and it is only a bit over an hour from Basel.
There is Rotenburg (without the H), a town in North West Germany. And there is another Rotenburg near Fulda. And there is a Rottenburg...
And then there is Rothenburg ob der Tauber. Which is where everyone wants to go to.
But Rot(h)enburg just means "Red Castle". So just like with Springfield in the US you have to be a bit more precise...
Regarding direct trains: Do not expect there to be direct trains between any two station pairs. That is not how it works. Changing trains is a normal and expected feature of train travel. Just look for a convenient route that fits your schedule.