Below are the two easiest ways to get Service:
1. Using the slingScriptHelper
ServiceType service = sling.getService(ServiceType.class);
2. Using adaptTo()
adaptTo() method that will translate the object to the class type being passed as the argument.
Node node = resource.adaptTo(Node.
More Info on Adaptors: http://dev.day.com/docs/en/cq/current/developing/sling-adapters.html