If you want to keep using your Apple networking gear, feel free to do so.
If your XFinity cable modem is a just a dumb modem, then connect its Ethernet port to your router (Time Capsule) WAN port. If it is a router/modem combo, set it into bridge mode (disabling its router features) and connect one of its LAN ports to your router’s WAN port
If you’d rather use a more modern router (to take advantage of faster Wi-Fi technologies), that’s fine too. In which case, set your Time Capsule into bridge mode (making it just a network storage device instead of a router+storage device).
If you do this, then you will need a router. You can use the XFinity modem if it is a modem/router combo device. If it’s just a dumb modem, then you’ll need to get your own router to go between the modem and the rest of your LAN.
I wouldn’t worry about what’s compatible with XFinity. Once the modem is connected and working, you have a fairly generic TCP/IP connection to the Internet. Similarly, all but the worst routers will do just fine connecting your LAN to the modem. Just make sure you get something fast enough to keep up with the service you’re paying for.
Wi-Fi 6 (802.11ax) is pretty new, so you’re going to pay a premium for it today, but you might want to do so in anticipation of future devices that can take advantage. I wouldn’t have any problem recommending a Wi-Fi 5 (802.11 ac) today either. I would not consider a router that only supports older standards (802.11 a/b/g/n without also supporting ac or ax). Those older protocols can’t keep up with the bandwidth requirements of modern devices.
I’m not going to recommend specific models because it’s been a while since I went shopping for routers. Just make sure you get a reliable brand that supports their products (especially firmware updates to fix bugs and security problems). Some of the cheap brands provide minimal support and may not have any updates at all after a year or two. I’m partial to Linksys (having used many of their products over the years), but also like Netgear and D-Link. These are all well-established brands with a long history of making consumer and small office networking gear.
BTW, if you’re leasing your modem from Comcast/XFinity, consider purchasing one. You will save quite a bit of money in the long run, even though you may end up paying a few hundred dollars up front. You can log in to your XFinity account and pull up a page showing modems that they support and promise to be compatible with your service tier. If you like, you can even buy the same model (but probably not the same physical device) you’re using right now.