secondary dominant chords?

Is there an easy way to figure out secondary dominant chords?? I understand why they’re needed but they’re so confusing. Any tips on how to analyze them?