For your full-quality photos to be backed up locally, you will want to go to Photos-->Preferences-->iCloud tab and select "Download Originals to this Mac". (I.e., NOT "Optimize Mac Storage".) Then all your photos will be downloaded at full size to your Mac, and Time Machine will back them up. IMHO everyone should back up their photos locally in case something disastrous happens to iCloud.
As for your other files in iCloud: I think this is the way to force them to be downloaded and kept locally (but I could be wrong): go to System Preferences-->iCloud Drive-->Options and UNCHECK (that is, disable) "Optimize Mac Storage". I believe this will cause all of your Desktop and Documents Folders files to be downloaded so that they can be backed up locally. Perhaps you can verify this (I don't use this option.)
I suppose after they're backed up you could turn the Optimize setting back on again -- but then you would never be guaranteed that changes to a particular document were backed up locally. Again, in my opinion, everyone should have at least one of their computers downloading those documents, for backup reasons.