When can a class in the fundamental group of a manifold be represented by an embedded loop? I am wondering whether there are any techniques for determining when a homotopy class in the fundamental group of a manifold can be represented by an embedded loop. In particular, are there any good techniques for surfaces?
I guess I'm just trying to find out whether there is active research in this direction, and to collect various techniques/references if they exist. My question initially came from reading about the loop theorem and the disk embedding theorem, which gives criteria for amps of disks, and I was wondering if there were similar ideas for loops.
 A: As a homotopy class embeds in a surface if and only if the geometric intersection number of the class with itself is 0, you can use, say, the algorithm of Schaefer-Sedgwick-Štefankovič to compute the geometric intersection number (of a curve represented by its intersections with a triangulation) quickly to check this.
Chris Arettines' thesis "The Geometry and Combinatorics of Closed Geodesics on Hyperbolic Surfaces" might be a good place to get some background on this topic. He gives a combinatorial algorithm to determine the minimal self-intersection number for closed orientable surfaces (other than the torus and the sphere, which as people have mentioned in the comments are known and a nice exercise). See p.19 of his thesis for a list of previously-developed algorithms.
If $S$ is orientable, closed, and has genus at least two, then it is hyperbolic -- it's a quotient of the hyperbolic plane by a group of isometries. In this case, a (non-trivial) homotopy class of curves lifts to a unique geodesic in the hyperbolic plane, and the minimum intersection number of two homotopy classes is realised by their geodesic representatives (the proof is essentially that minimum intersection number is realised if and only if there are no bigons, and these geodesic representatives can't give bigons as they are length-minimising). So that's a more geometric approach than those already mentioned.
Schaefer, Marcus; Sedgwick, Eric; Štefankovič, Daniel Computing Dehn twists and geometric intersection numbers in polynomial time, In Proceedings of the 20th Canadian Conference on
Computational Geometry, volume 20, 111-114 (2008). (https://ovid.cs.depaul.edu/documents/geometric.pdf).
