Spell the diatonic chords
Every chord that belongs to a key is built from that key's seven names, and nothing else. No new accidentals ever appear.
So spelling a diatonic chord is two easy steps: stack every other letter from the chord's root, then take each accidental straight from the key signature.
Chord IV of A major starts on D: D, F, A. A major already contains F♯, so the chord is D, F♯, A. You never had to decide anything — the key decided for you.
Stack every other letter, spell from the key
Chord IV of A major: D, F♯, A. The F♯ comes from the key itself.
Practise this in the trainer — it opens with this lesson the first time the concept comes up.