I think this short step-by-step guide that I made will help you:
Connect to your database:
Go to the Database Tool Window
in IntelliJ (Path: View > Tools/Tool Windows > Database)
Add your database connection by clicking on: +
icon and selecting your database type.
Enter your connection details (host, port, username. password, other authentication factors etc.)
Enable JPA Support in IntelliJ:
Generate Entity Classes:
In the Database Tool Window you should expand your Schema and find the tables you want to generate entity classes for.
Right-click on it and an option like: Generate-POJO
or Generate Enitties
should appear.
This is it assembled short and easy.
Recommendations:
If you don't have lots of entities to create, you can code those by hand quite fast and save some time, rather than spending it on countless clicking to do this.
I personally prefer this manual approach as it is more intuitive and can train you into further more understand how the relations between Java and other resources and databases work.
Resources for further help:
Similar question with lots of answers: How can I generate entities classes from database using Spring Boot and IntelliJ Idea?