If one of my Pokemon was knocked out by an effect of an attack or an Ability, would I still be able to play Letter of Encouragement?
Yes, there is no restriction on how the Pokemon was Knocked Out. However, a KO during Pokemon Checkup such as from Poison or Burn would not count.
Source: Obsidian Flames FAQ; TPCi Rules Team (2023-08-10)

Relevant cards

Note: All applicable cards may not be listed below.
SV3_189