General guidance across the US, UK, Canada and EU is that sexually active adults should have at least an annual STI check. More frequent testing - typically every 3 to 6 months - is advised if you have new or multiple partners, inconsistent condom use, a partner with an STI, or if you belong to a higher-risk group such as men who have sex with men or people taking HIV pre-exposure prophylaxis.
It is also sensible to test before starting sex with a new partner, after unprotected sex, and if a current or former partner tells you they have an STI. Some infections (like HIV, syphilis, hepatitis B and C) are blood tests, while chlamydia and gonorrhoea are usually urine or swab tests.
Your ideal schedule is individual. A licensed doctor or sexual-health service can recommend the right frequency and the right panel of tests for your situation, and many regions offer free or low-cost confidential testing.