The most immediate expenses they will have to deal with are the costs involved in transporting your body internationally, as well as the usual costs of death such as a burial/cremation, funeral, and any other last wishes you had.
After that, they will be able to use the money however they see fit, and spend it however they choose. In your instructions to the insurance company, you can choose who receives the money, and how the total amount is split if you have more than one beneficiary – the insurance company sends them the money, but cannot control what they spend it on.
If you want to determine what the money gets spent on, you would need other arrangements in addition to your life insurance policy. For example, you could set up a trust fund (and make the trust fund the beneficiary of your life insurance) which has clear instructions on what the beneficiaries can and cannot spend the money on, and appoint a trustee. If you have children, you may choose to nominate a legal guardian to manage their affairs if you unexpectedly died young, and make the guardian a beneficiary of your life insurance.
If you want to set up any arrangements in addition to simply nominating who receives the funds from your life insurance, you’ll need to speak with a lawyer in either your home country or your main country of residence to do this.