Handle ants yourself; call a pro for termites.
Ants you can manage with bait and sealing; termites are not a DIY job.
For ants, the trick is baiting, not spraying. A gel bait or a few little stations near where you see them works better than killing the ones you see. They take the poison back to the nest. Also, seal cracks around baseboards and windows, and keep surfaces crumb-free. Takes a week, but it works.
Termites are different. If you see mud tubes, discarded wings, or hollow-sounding wood, stop Googling and call a pest control company. Termite treatments need specialized equipment and knowledge – the wrong approach can scatter the colony or miss the queen. Damage adds up fast, and insurance rarely covers it.
Spend the energy on ant prevention. For termites, spend the money on an inspection.