We consider three different diffusion processes in a system with a thin membrane: normal diffusion, classical subdiffusion, and slow subdiffusion. We conduct the considerations following the rule: {\it If a diffusion equation is derived from a certain theoretical model, boundary conditions at a thin membrane should also be derived from this model with additional assumptions taking into account selective properties of the membrane}. To derive diffusion equations and boundary conditions at a thin membrane, we use a particle random walk model in one-dimensional membrane system in which space and time variables are discrete. Then we move from discrete to continuous variables. We show that the boundary conditions depend on both selective properties of the membrane and a type of diffusion in the system.