These are two words that unfortunately don’t have super good English translations . The main difference is that だけ focuses on a group of things, where one of those things is being removed/highlighted. ただ on the other hand translates a bit closer to ‘as it is’ (with focus on not adding or removing anything).
Maybe simpler-
ただ = (A) is just (A), however…
This is similar to the phrase ‘that said’ in English, where people simply acknowledge their previous statement before adding more info. For example “I love apples… that said, if it’s rotten, of course I won’t eat it”. So ただ should only really be used when you want to acknowledge a statement as being complete by itself, before adding more info.
だけ = From among (A), (B), and (C)… (A)
This is much closer to ‘only’ in English, but has a finer nuance than ‘only’. だけ cannot be used in cases where there is only one choice to begin with, there must be several.