People raise the limit in a terminal and wonder why their service still fails.
ulimit -Sn
ulimit -Hn
ulimit -Sn 4096
ulimit -Sn shows the soft limit on open files for the current shell and the programs it starts. In bash, ulimit -n 4096 without -S sets the soft and the hard limit, and an unprivileged user cannot raise the hard limit again afterwards, so use -S. You can raise the soft limit up to the hard limit shown by ulimit -Hn, and only for this shell and its children. A systemd service ignores it and needs LimitNOFILE= in its unit.
Further reading: Bash Reference Manual