Help with processing brackets

I have been continuously brainstorming and being unsure about how to make a string input be processed by its brackets, so that math can be done in the order specified by the brackets. The closest thing I have ever created is a system where one operation takes place on a series of inputs.

If anyone would have any ideas on how to create this system where operations are done in order specified by brackets, your help would be much appreciated.

I plan to use this for a programming language I want to make in Snap! for fun.

reverse polish notation

I looked into it, and it seems pretty cool, alongside regular Polish Notation, but it doesn't really help for my goal of creating a regular style of programming math. Although, I think Polish Notation will at least be a decent stopgap to let me write other parts of a language because of how mechanical it is.

actually i dont understand poish notation either

Here you go:

https://people.eecs.berkeley.edu/~bh/v3ch5/langi.html

here u go:
craftinginterpreters.com

I like that it has a chapter called "Closures."