It’s safe unless you run an exit node. All my VPS’s run tor relays (mostly bridges) except for the IPV6-only servers where the support still isn’t there. In my opinion all VPS’s should be running Tor relays unless you have a specific reason not to (like if you have less than 1GB RAM you probably shouldn’t). All the documentation is on the Tor website. Read up & decide if you want to run a normal relay or a bridge and follow the instructions accordingly.
As an alternative to (or in addition to) a relay/bridge, you can also run one or more instances of Snowflake Proxy which is a special type of Tor on-ramp that doesn’t require running a full Tor instance, making it more suitable for low-RAM systems.
Use a decent VPS instead of trying to host off a residential internet connection behind 47 layers of NAT and you don’t have to worry about 90% of that stuff
i.e. use the right tool for the job