How is いい being used in this sentence?


> もしも僕に心があるならどうやってそれをみつければいいの

I understand the sentence translates along the lines of "If I had a heart, how
would I find it?" And I know "いい" means "good/fine/etc" but I'm not sure how
to fit that into the translation. Unless it's serving as another word I don't
know.

Thanks for the help!




`conditional form (eba-form) + いい/よい` is a very common pattern which literally
means "will be good if ～", but essentially means just "can" or "should". See:
[Learn JLPT N3 Grammar: ばいい (ba
ii)](https://japanesetest4you.com/flashcard/learn-
jlpt-n3-grammar-%E3%81%B0%E3%81%84%E3%81%84-baii/)

  * **どうやって** : how
  * **それ** : it
  * **を** : (object marker)
  * **見つければいい** : should find / can find 
    * 見つければ: conditional form of 見つける
    * いい: good
  * **の** : explanatory-の used to seek for clarification

Thus "How should/can I find it?"

Note that this pattern is so common that いい/よい may even be omitted.

>   * 何をすれば？  
>  What should I do?
>   * 行けば？  
>  Why don't you go?
>

