You would apply for a COE first because it confirms to your lender that you are qualified for the VA home loan benefit.
How do I apply by mail for the COE?
Can I use the same COE I used to purchase my current home if I am relocating?
You may be able to restore an entitlement you used in the past to buy another home with a VA direct or VA-backed loan if you meet certain requirements.