IntelliJ, "class main is public, should be declared in a file named"

This error message is telling me what to do about this error, however I am new to this environment and have no idea how to proceed with fixing this. I am trying to code and run the first coding project in the Java course. I am totally stalled! Do not know how to fix this. I need help!
Thanks, Tom

I found a link in InteliJ that said it would fix my issue. I clicked on it and it DID fix it by renaming one of my entries in my program code. Though it did get me moving along, I really did not learn anything from it because I do not understand why it fixed my problem.

The IDE was expecting a file with the following method in it:

public static void main(String[] args) {
    // your code goes here