You don’t vote for president directly in the US, you vote for your state to send its votes to that ticket.
Nothing anybody will explain here will be as good as a quick video. I suggest searching your question into your search engine of choice
This is why some voters feel disenfranchised from voting. Republicans in NY and CA may as well not exist. Democrats in Idaho, and Iowa may as well not exist. Because of the reasons you said.
That being said, Texas democrats need to get off their asses. Their state is only republican because of nonźvoters. Some states it’s hopeless, and then there’s Texas, which absolutely SHOULD at the very least be a swing state. But it’s not.
It’s worth remembering that voter apathy is part of the process. The status quo is built on the idea that people don’t change, but people change every day. If Democrats started showing up in Idaho, the way Republicans do in California, they’d get a lot more attention. The GOP spends a lot of time and effort buttering bread in Orange County, because even though they can’t win a statewide election, they will provide constant pressure on the state and federal government (not to mention all the money).
Not just voter apathy, but voter discouragement. If districts were divided logically, Republicans wouldn’t win many key areas through gerrymandering. Then there’s manipulation of polling places in different ways to make voting more difficult or even frightening for some people to show up. A fair election doesn’t work well for the GOP, so they make sure everything is done to help their results. And this time around they may be doing even more subtle things - see recent news of Steve Bannon’s admission of having people in place to question voter authenticity. More scare tactics.