I have clear mucus in my throat only when I eat or lay down to sleep. What causes that? Can it be caused from your heart? Started when I got bad edema

Possibly. These could be symptoms of congestive heart failure. The triad of difficulty breathing when laying flat, shortness of breath to exertion, and lower extremity swelling are all classic signs. Moreso still if the breathing is much better shortly after sitting upright. If you are waking up w/in a few hours of going to sleep gasping for breath or choking, this also fits. Only your doc can tell for sure.

Related Questions

I get clear mucus in my throat only after I eat and when I lay down to sleep. Can it be caused from my heart. Started when I got severe edema.

Sounds like reflux. Not from your heart at all. Most likely juice from your stomach is coming up "silently" without heartburn. You want to not eat or drink before laying down for at least a few hours. Stay away from acids like lemon, orange juice, coffee etc.