If you want to avoid the tedium of doing this by hand, there are any number of edging devices for sale via Amazon or hardware stores.
Hi! this one has great reviews!
This is a good tutorial: https://youtu.be/bwlEqjlEPQw
This video shows how to edge a lawn with a shovel or a power edger, whichever one you have: https://youtu.be/-py2wXOsLAM
I use my cheap cordless Black & Decker weed whip on its edge or titled up on its side.
I also use it for mowing the wet ditch on part of my property, where the lawnmower can’t go.
Its batteries fit B&D’s other yard tools, like a Saws-All, for those tree limbs that have to go, or firewood.
check that pin https://www.pinterest.com/pin/432978951670790949/
here is some info to help you out
We just use our weedeater, turn it on its side. But if you want a super neat line, you can get an edger at the hardware store.
An edger will help. We've used it around our garden beds