Basic methods include: 1) footings wide enough to support the loads, 2) pilings to bedrock, 3) friction pilings; and there may be others (e.g., pontoons on quicksand?).
In case (1) there should exist some textbook data on the load bearing capacity of various types of soils, and this may be supplemented by on-site soils testing. Then size the footings to match the loads transmitted to them by the foundation walls.
In case (2) each column (piling) strength can be calculated; then space pilings accordingly. (I don't remember if pilings are considered to be laterally supported; might depend on soil stability.)
Case (3) I am unfamiliar with; again there is probably some textbook information on it.
There are enough variables here, including site conditions, that real civil and/or structural engineering input would be desirable, if not code-mandated. I'm neither, so these are just some basic ideas to get the ball rolling.
(You need not rely on the advice of the Biblical parable. Nor the three little pigs; straw-bale buildings can be properly designed, too.)
__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
there are an awful lot of basic principles which you are obviously not aware of and so - if your project is anything other than a short garden wall - get a qualified engineer to advise you.
otherwise the load bearing capacity for a sandy soil is about 25kN/m2.