Notes from a witch who is a part-time caretaker of a rural graveyard:
Disclaimer: These are both mundane and magical personal observations and recommendations acquired from living directly beside, working part-time for, and working with the spirits of a rural graveyard.
If the grass is being cut regularly, the graveyard/cemetery is being looked after. Even if headstones are neglected and the decorations rarely change at the graves, someone is coming out regularly to check things out.
Even if you know for a fact a graveyard/cemetery is abandoned, it does not mean it's been entirely forgotten. You're probably not the first person to stumble upon it and probably won't be the last. Don't ruin it for others by desecrating graves or damaging the natural environment.
Be mindful of rules and be respectful of the cultural practices of the graveyard/cemetery. Some graveyards/cemeteries have regulations as to what can be left at a grave; either in general or during certain seasons, or they may have set visiting hours; often in an attempt to deter nocturnal mischief makers.
If you are ever questioned as to why you are there, be calm and courteous. You don't have to divulge your spiritual practice, but simply explaining that you're visiting out of an interest in history can more often than not put suspicious minds at ease. However, if you are explicitly asked to leave, by the living or the dead, do so. There is no sense in arguing and it may be for a good reason.
This may be personal preference or may depend on whether or not you have built up a connection with the graveyard/cemetery (spirit/guardian/etc), but when in doubt: come with protection.
Avoid leaning, standing or pushing on headstones. It is not uncommon for stones to topple, especially those with preexisting damage, those made out of softer material like limestone, or those simply not designed to take much force.
Sometimes stepping on a grave is inevitable. Politely apologize and carry on.
You can show respect and still laugh, joke, tell stories, etc. There's no rule saying you must keep the mood sombre.
If you will be doing any type of magical workings, ask permission and respect the answer. This goes especially for any workings done at a specific grave.
When finished, give your thanks and take all non-biodegradable tools/spell ingredients/offerings with you. You could even pick up trash as you leave, but be mindful of what may be a misplaced decoration or offering.
If you want to clean/repair headstones or cleanup the general area of the graveyard, do your research and go through the proper legal channels. Your intent may be good; but if you don't know what cleaners/tools to use or mistake a misplaced decoration as trash, you could unintentionally do more harm than good.
If you require grave dirt or other forageable matter, tread lightly. Only take what you need and opt to take from the perimeter over a specific grave*.
When you are finished with your workings and are ready to head home, say goodbye and leave the spirits at the gate. You can cleanse yourself and your tools once you've crossed the threshold or as soon as you've gotten home.
*Removing dirt from a grave is often viewed as immoral and depending on your location may even be illegal (desecration of a grave). <- I'm not mentioning this last bit as a scare tactic, just as a reminder that you never know how your actions will be interpreted by outside eyes.
As an alternative to grave dirt, consider this: The earth has been around for 4.5 billion years. In that time, many a thing has lived and died across its surface. Dirt is made of decaying and decomposed matter. So technically speaking, the entire planet is a series of unmarked lost graves, making all dirt grave dirt.