It’s easy! I draw my lineart freehand on sai, so my lineart layer is always transparent by default. Knowing that, I just use Opacity Lock to lock all the transparent pixels!
Make sure the lineart layer has that little square checked-
I tend to have the colors I want to use handy. Once the layer is locked, I start coloring the lines slowly and carefully-
And I keep this up until everything I want colored is finished-
And that’s it! I actually color my lines AFTER I finish my base colors/shading so I can see exactly what colors I can use to make them stand out.
If you scan your lineart, however, it’s not transparent by default and unless you do some other things to make it transparent (I never scan lineart so I can’t tell you how to do this, sorry!), opacity lock won’t work the way you want it to-
So, what you can do, if you’re lazy like me and don’t care to make the lineart transparent, is just make a new layer on TOP of your lineart and set it to screen like so-
And just color your lines on that layer! Make sure when you’re ABSOLUTELY DONE to merge the coloring layer with the lineart layer so when you set the lineart layer to multiply (so you can actually apply your base colors), your base colors won’t look weird.
And there you have it! Hope that helps!