When I installed Oracle Database 21c, it did not automatically create the tnsnames.ora and listeners.ora files for me. I tried creating a listener "LISTENER1" with the tool it comes with but I don't know how to use it and even so it didn't create the corresponding files in the network folder of the database.
In the end I uninstalled and reinstalled following the steps at https://www.youtube.com/watch?v=DYleroLay5E&list=LL5mVVsrAc9rtp3xBJTJUAow
I checked what my hostname was for the connection string and in the sql developer instead of SID I put the service name.