I had bad nails for years, I'm just not one of those lucky ones born with strong & fast growing nails. It got as bad as horizontal splitting and regular cracking, seemingly a hopeless case. It meant I practically ignored classical guitar for a long time, just playing other styles with a pick. Furthermore I am a regular swimmer and we should all know that frequent exposure to water (especially water with chemicals added, like dishwater) weakens nails. Now my nails are in fairly good - and consistent - shape, but I had to work at it and tried several things before settling into a routine which includes the following:
* Biotin supplements, preferably daily
* An Omega 3 fish oil pill daily
* Wearing rubber gloves when in prolonged contact with dishwater etc (but not swimming, that would be too weird and virtually impossible to prevent water contact)
* Wearing tough gloves when doing household stuff like chopping wood, DIY etc
* Placing keys in left hand pocket, undoing zips with left hand etc
* Moisturising hands regularly, but not straight after they get wet, with a nail strengthening moisturiser
* Rubbing oil into nails, on the infrequent occasions when I know my nails won't come into contact with anything else (e.g. just before embarking on a car journey). I normally do this once or twice per day. I use two oils at present: my last supplies of something called Tuff Nail (ingredients unknown), which has now sadly ceased trading - and Flexinail, based on guitarist-led recommendations. The latter is expensive, but lasts a long time. When those two aren't to hand, the odd rubbing in of EV Olive Oil or similar will do. Anything to moisturise nails and give them a protective layer is better than nothing at all.
* Using the best/finest nail files I can get. Crystal are good as long as the file has a fine side - and the two finest sides of those cuboid buffing blocks you can find in any chemist/supermarket. Use them as soon as you feel roughness on your nail, or anything more serious !
* Using fine grade water paper, folded over several strings of my guitar and playing the water paper covered strings. This last technique produces the most reliable playing-grade edge to my nails. Check out the French guitarist Thomas Viloteau, who has a video somewhere on his website or YT channel detailing how he does it.
* Keeping my nails' length just right: I find I need only 1.5 - 2mm peeking over the top of my fingertips to play effectively; over my thumb it's more like 3 - 3.5mm.
* Sunshine ! I know this is a tough one for some of us....but it's good for strong nails and skin/hair etc
* Playing - there is no doubt in my mind, despite no scientific evidence I am aware of, that playing with nails helps promote strong nails.
Hope this helps someone. Good luck !