LanguageTool is an Open Source alternative to Grammarly that can check your grammar as you type.
Unlike Grammarly, it does not have a Terms of Use that gives the company full access to your work. LanguageTool has a basic plugin for LibreOffice and an extension for Firefox and Chrome browsers. The paid account will catch more errors and have more options, but the free option is a decent start. You can also consider ProWritingAid as an alternative to LanguageTool.