I mean, you could use a ruler with your tablet. A tablet and stylus are still physical objects that interact with a physical ruler. If yohr tablet is a screen, this is made even easier.
In terms of purely digital solutions though, some applications let you draw perfectly straight lights with the brush tool by clicking to make a mark, then holding shift down and clicking elsewhere (point A to point B). Paintstorm has rulers and perspective built into it, and if you want a solution for every application, then Lazy Nezumi Pro works. It's a bit pricey (like 65 USD or something), but it is a program which can be used with theoretically any drawing/painting software (it has specific integration focus on photoshop, but is marketed to work elsewhere and I've used it with Paint Tool SAI). It has a robust set of stabilizers, rulers, patterns, etc. And is worth Googling.
If you want to get really low tech though, Google something like "perspective grid" or "perspective grid template" and then copy the image, paste it into your art app, and resize it to suit your needs.