You can take the bus/subway on arrival at 10PM, but it will be a slower option than Lyft/Uber at that hour. If you are leaving LGA after 10:15PM transit will be even slower: lower frequencies, E is local by ~11PM, F could be local with late-night maintenance. Q70 however will be fast (when it appears) to Jackson Heights since it stops at terminal C/D last. But it will be much cheaper.
There's also the Lyft/Uber pool options, but those can be a big miss and can drag on the length of the ride to save ~$10. Depending on your destination this may not be faster than transit (and still more expensive). If you get the "PIN" pickup from Lyft/Uber that is the fastest option at that hour. If one of Lyft/Uber matches you to a car driving somewhere in Queens (no PIN and the car not coming from a lot near LGA) I would try the other service immediately. The driver may not want to go to LGA and may cancel or wait for you to cancel.