In Section 1 we review various equivalent definitions of a vertex algebra V. The main novelty here is the definition in terms of an indefinite integral of the lambda-bracket. In Section 2 we construct, in the most general framework, the Zhu algebra Zhu_G V, an associative algebra which controls G-twisted representations of the vertex algebra V with a given Hamiltonian operator H. An important special case of this construction is the H-twisted Zhu algebra Zhu_H V. In Section 3 we review the theory of non-linear Lie conformal algebras (respectively non-linear Lie algebras). Their universal enveloping vertex algebras (resp. universal enveloping algebras) form an important class of freely generated vertex algebras (resp. PBW generated associative algebras). We also introduce the H-twisted Zhu non-linear Lie algebra Zhu_H R of a non-linear Lie conformal algebra R and we show that its universal enveloping algebra is isomorphic to the H-twisted Zhu algebra of the universal enveloping vertex algebra of R. After a discussion of the necessary cohomological material in Section 4, we review in Section 5 the construction and basic properties of affine and finite W-algebras, obtained by the method of quantum Hamiltonian reduction. Those are some of the most intensively studied examples of freely generated vertex algebras and PBW generated associative algebras. Applying the machinery developed in Sections 3 and 4, we then show that the H-twisted Zhu algebra of an affine W-algebra is isomorphic to the finite W-algebra, attached to the same data. In Section 6 we define the Zhu algebra of a Poisson vertex algebra, and we discuss quasiclassical limits.