You can create your CGI scripts and store them in your cgi-bin, and then run or access these scripts through your browser by calling them through their URL. These scripts usually have the .pl or .py file extensions (from the Perl and Python programming languages). Please make sure to set the permission of your cgi-bin folder to 0755 to make the scripts executable.
Example:
https://www.example.com/cgi-bin/samplescript.pl