How to ensure fat stays in meat/fish?
Fat will melt at high temperature (temperature depends on the type of fat); there is not real way to get away from that.

If you pan fry a steak, the fat will melt into the pan; that is why most people suggest a good "marbling" of fat in the meat so not all of it will melt away.

One cooking method, that I think will help keep most of the fat in the meat is low temperature vacuum cooking. 

Put the meat in vacuum sealed bag and cook at low temperature (check instructions) in a water bath; after a while, the meat will be cooked and the fat will not have melt away; just finish in a pan to sear the outside.

See:
https://www.thekitchn.com/sous-vide-cooking-this-is-the-best-steak-ive-ever-had-197056