JMeter supports several scripting languages, from performance perspective it's recommended to use JSR223 Sampler and Groovy as a language.
If your script is "light" and doesn't assume running in multiple threads you can consider Beanshell. How to use BeanShell guide is a good place to start for JMeter scripting.
If you could describe your use case in more details perhaps we might find the way to do it without scripting, JMeter is powerful and flexible enough.