If you needed to go straight to Times Square the easiest public transit route is: M60-SBS express bus (signs in the airport should lead you there) to Astoria Blvd, then get on the N or W train from there to the 42nd Street/Times Square train station (roughly 45 minutes). You could take a cab instead of the M60 to save some time but it'd cost more (guessing $8-10).
What Daniel said was accurate. There are however a few express buses that will connect you to the trains quickly. For example I take the m60 which takes me through queens via Astoria Blvd (a major road ) and then into Manhattan I get off at 125 in Harlem which is a major station and take the 5 into the Bronx.
There's no train to take you from La Guardia Airport into Manhattan. You could either catch a bus to take you to a subway station or take a shuttle directly to Manhattan
Thanks! Your answer is awaiting moderation.