Joshua could not lead Israel against its remaining enemies, but he could not in good conscience let Israel have its land yet. He needed guidance, and God gave it. God also gives us guidance on dealing with the dilemmas we fall into—through His Word. Read your Bible regularly, asking the Holy Spirit to help you understand and apply it.
David was of the tribe of Judah, but he sometimes speaks like a Levite, referring to God as his “portion” or “inheritance” (Pss. 16:5; 142:5). He wanted God more than land or treasure. We, too, should see God as our supreme treasure and count it our greatest blessing to possess Him and be possessed by Him.