One of the best advice I can give to an aspiring developer is to stop cowboy coding and to NEVER EVER work directly on the production version of your website. When you start out working, especially on a CMS like WordPress, it is very tempting to do just that one small change directly on the live site. That is until you make a mistake and brick the whole thing.
Most modern hosting companies offer a one-click way to create a staging copy or your site and even if your provider does not, it is really easy to spin one up using tools like Local by Flywheel and site duplication plugins for your CMS. That will save you A LOT of grief down the road.