[verb (ば-form)] + いい [verb ない-form 〜ない → 〜なければ] + いい [i-adj 〜い → 〜ければ] + いい
ばいい is the ば-form of a verb followed by いい: "it would be fine if you…", "all you have to do is…". It gives simple advice, and with a question word it asks for it. The verb changes its last sound to the え-row and takes ば: きけば聞けばいい, たべれば食べればいい, すればいい.
The advice is that the answer is easy. Said flatly to someone with a real problem, it can sound offhand; よ at the end makes it friendlier.
With どう, なん何, どこ or いつ, ばいい asks for advice: "what should I…?". This is the usual way to ask, polite with ですか.
たらいい means the same here and is a little more conversational: どうしたらいいですか.Ending in な or なあ, ばいい says what you hope will happen.
With のに, it is a wish against the facts: "if only". Said about someone else, it turns into a complaint that they didn't do the obvious thing.