To start, structure your application as a stack of N layers or tiers:
Each layer depends on the layer below, but not vice-versa.
Each layer can have the same functionality but at different levels of abstraction. This is the idea behind the internet architecture and the UNIX architecture.
Or, each layer can have different functionality. Here are some typical examples:
Layer3 = user interface
Layer2 = business logic
Layer1 = database
Layer3 = web server
Layer2 = application server
Layer1 = database server
Layers can run on different computers. In this case we usually refer to the layers as tiers. We can view this as a kind of multi-tier client-server architecture.