FreeBSD comes with a large collection of software that was already ported to FreeBSD.
To find out if a software was already ported to FreeBSD you can go to freshports.org and use the search page.
Using Packages
Since FreeBSD 10 there is the new package manager pkgng, which brings a lot of new features to FreeBSD.
For example to search for a port.
$ pkg search -o erlang
lang/erlang
databases/erlang-mysql
lang/erlang-runtime15
lang/erlang-runtime16
net/erlang_xmlrpc
So we see that Erlang was already ported to FreeBSD and we could just install it with
pkg install lang/erlang
Using Ports
Alternatively there is the ports tree under /usr/ports where you can automatically receive the source code of a port and compile and install it.
The ports tree is not always installed since it can take a little bit of space.
So if /usr/ports is empty you first need to install the ports tree.
# portsnap fetch
# portsnap extract
Inside the ports tree you can search with
#cd /usr/ports/
#make quicksearch name="erlang"
...
Port: erlang-16.b.03.1,3
Path: /usr/ports/lang/erlang
Info: A functional programming language from Ericsson
...
or install software by using the path from the search
#cd /usr/ports/lang/erlang/
#make install clean
Using ports to install and update programs is a little bit harder than using the pkgng and now a beginner should use pkgng over ports.
Both pkgng and ports take care of all the dependencies a package or port need, so if you install Erlang it will also install OpenSSL and Perl and you don't need to do anything else.
The ports also install software which is needed to build it. For Erlang this adds Gnu make to the list.
You should read the chapter 5 of the FreeBSD Handbook it explains a lot more about ports and packages and is well written and available in multiple languages.