# How would you find a p threshold for a binary classification prediction?

Lets say that there's a binary classification problem where $$X$$$$R_p$$ and $$Y ∈ \{0,1\}$$ and $$Pr(Y = 1 | X = x) = p$$ for $$p$$ in $$[0,1]$$. There is a loss function $$L_{falseneg} > 0$$ for false prediction of Y = 0 when the outcome is Y = 1, and vice versa for $$L_{falsepos}$$. How would you find a threshold value so that expected loss criterion for making a prediction is equivalent to predicting $$Y= 1$$ if $$p ≥ threshold$$ and predicting $$Y = 0$$ otherwise.

I thought about approaching it using Neymay Pearson Test, but would there be a simpler way to do this?