On IRS Form 8889, there is a “Limitation Chart And Worksheet” to help you figure this out. Don’t worry, it’s not difficult and you can figure it out pretty quickly.
Source: "Publication 969 (2018), Health Savings Accounts and Other Tax-Favored Health Plans.”
Updated: