Sometimes we want to use soil in planted aquarium areas while using cosmetic sand to create a path or a beach in part of the aquascape.
For convenience, many aquascapers nowadays just layer sand thickly over aquasoil in areas that they require cosmetic sand. The sand layer must be thick enough so that the aquasoil doesn't float up. Hardscape is usually used to border the sand.
Plants with deep roots should not be planted in such areas else aquasoil will get pulled up during replanting cycles. If aquasoil rises to the surface of the sand; just vacuum it up with a siphon during water changes. Due to the low organic content of aquasoil, layering the soil thickly using this method doesn't cause issues in the long run.
For those that want to keep the areas separate there are a couple of different approaches; first is by growing a carpet that overlaps both areas - the plants will hold the soil from both areas separate. Carpeting plants such as HC and MC work well. For larger texture, Limnophila vietnam and Staurogyne repens work well as they do not require frequent replanting.
The other way is by lining the path with rocks/coarser rock which forms a heavier border that keeps both areas separate. This is where having smaller pieces of rock to match larger pieces can be very useful.
Using plastic sheets as dividers tend to create an unnatural look and plastic is easily visible among sparsely planted areas so I do not advice using this method.