Anyons are particlelike excitations of strongly correlated phases of matter with fractional statistics, characterized by nontrivial changes in the wave function, generalizing Bose and Fermi statistics, when two of them are interchanged. This can be used to perform quantum computations [A. Yu. Kitaev, Ann. Phys. (N.Y.) 303, 2 (2003)]. We show how to simulate the creation and manipulation of Abelian and non- Abelian anyons in topological lattice models using trapped atoms in optical lattices. Our proposal, feasible with present technology, requires an ancilla particle which can undergo single-particle gates, be moved close to each constituent of the lattice and undergo a simple quantum gate, and be detected.