Here’s a link to help you get started https://docs.fivem.net/server-manual/setting-up-a-server/
A lot of information on that site will be helpful to you.
Afterwards you can start with https://docs.fivem.net/scripting-manual/