Both Pearson and Spearman quantify the degree of linear association between pairs of scores (Pearson) and the ranks of pairs of scores (Spearman). If you think the nature of the association between the variables you're investigating might not be linear, then another type of measure of correlation would be more appropriate.
The chief distinction between Pearson and Spearman has to do with the presumed scale of the variables involved. If both variables are on equal-interval scales, then Pearson is the better option. If one or both variables are only on an ordered or ordinal scale, then Spearman is the better option.
If one or both variables are categorical, and unordered, and each one has more than two levels, then a different measure, such as the phi coefficient, would be preferable. However, even for categorical, if both variables have only two levels (like sex at birth), then Pearson will work.
It's depends on your variables, if categorical (nominal) you can use Chi-Square,
AND if continuous variables with normal distribution and without outliers you can test with Pearson Correlation, also if one continuous and the other is binary you can test with biserial correlation, if not follow the normal distribution with outliers the alternative is Spearman Correlation (non-parametric).
for more details about both correlation tests, these are very useful websites:
first you must check the normality of you're data distributions with K-S test. if you're distribution was normal you can use Pearson correlation coefficient and if it was not normal you can use Spearman correlation coefficient .