Up until yesterday (Expired May 25th) you could use a prebuilt SharePoint 2016 VM in Azure. I expect they will either release an updated one soon, or wait a month or two and release a SharePoint 2019 version.
You can use any cloud host service (such as Azure) to build a SharePoint 2016 VM using the trial versions of the SharePoint software (https://www.microsoft.com/en-us/download/details.aspx?id=51493). If you remember to turn off the VMs when not in use, the cost can be quite resonable.
If your PC/laptop has enough RAM, you can build a test environment using HyperV or VirtualBox. While the "requirements" are much higher, I do my development with a VirtualBox VM with only 12 GB of RAM. It runs SP2016, SQL, Visual Studio, and other tools. (I install and run the test browsers and SharePoint Designer outside of the VM.)