まずは少し文法を勉強しないとな。
Which is to say: to understand this construction, you "need to" learn how to express “need to” in Japanese. I recommend you read the following comprehensive Guide To Japanese article from start to finish: Expressing “must” or “have to”.
As you'll see, there are many forms of what is essentially the same construction. The first half of that article covers the unabbreviated forms, which includes the と-form with 2 examples:
毎日学校に行かないとだめです。
Must go to school everyday.
宿題をしないといけない
Have to do homework.
The second part of that article mentions their abbreviated forms, which are actually a lot more commonly used than their verbose counterparts—in spoken/casual language at least. Here you'll find the unabbreviatedabbreviated と-form too:
The 「と」 conditional is also used by itself to imply 「だめ/いけない/ならない」.
学校に行かないと。
Gotta go to school.