Everything the Tor daemon does beyond defaults is set in torrc, one option per line. On Debian and Ubuntu it's at /etc/tor/torrc. In Tor Browser it lives inside the browser folder under TorBrowser/Data/Tor/torrc, though Tor Browser rewrites parts of it through its settings screens, so hand edits there can be overwritten.
A minimal onion service needs just two lines:
HiddenServiceDir /var/lib/tor/mysite/
HiddenServicePort 80 127.0.0.1:8080
Relay operators set ORPort, Nickname, ContactInfo, bandwidth limits and either ExitRelay 0 or an ExitPolicy. Censored users add UseBridges 1, a ClientTransportPlugin line and one or more Bridge lines.
After editing, run tor --verify-config to catch typos, then reload the service. Tor's manual page (man tor) documents every option and is better than most blog posts. One common mistake: copying options like StrictNodes or ExitNodes from forum advice. Restricting which relays you use usually makes you more unusual, not safer.