Officially, a member of Congress. In reality (and I hope this doesn’t drift into GD territory…) many of our bills are ghostwritten by industry lobbyists, think tanks, etc. Many of them are voted on and passed nearly verbatim and without being fully read by the elected representatives, although you’d hope that at least their staffers read and summarized them. See Model act - Wikipedia and When Lobbyists Literally Write The Bill : It's All Politics : NPR
Someone explained the TikTok situation already, but generally speaking, this isn’t a black-and-white matter. Nothing in US law is. The thing to keep in mind is that every passed legislation is always up for debate and different enforcement mechanisms and outright malfeasance, and if the different branches of government are really at odds (like a split red/blue government), each will try whatever it can to get its way. It’s a political process of give-and-take, tit-for-tat, not just a simple, straightforward pipeline.
From “someone had an idea” to “they drafted the first version of the bill” to “now it’s passed” to “the police/IRS/EPA/DHS will go after you for this”, each step of a law being drafted, passed, and enforced is subject to numerous political interventions, some of which will effectively make it dead in the water even if it’s on the books.
For example, even though weed is federally illegal (under the Controlled Substances Act, I think), various presidents will bend the rules to try to limit federal enforcement actions: https://crsreports.congress.gov/product/pdf/LSB/LSB10655
Presidents can use executive orders, vetoes (including pocket vetoes, where they just ignore a bill), the bully pulpit to push for/against things, etc. By and large, if the President is popular enough (among Congress and the populace at large), they can get away with just about anything, because the only real check on their power is impeachment & conviction. If the Congress refuses to do that, there’s no outside force (short of a coup) that can really stop the President from doing something, no matter its legality. Because of this, the power of the presidency has waxed and waned over time as different presidents try to stretch the rules in novel ways, only to be eventually reined in by Congress in subsequent years.
If the President unilaterally orders something but Congress doesn’t like it, they may try to allocate budget away from whatever that thing/agency is (or just pass a bill directly prohibiting it). They can also outright impeach the president, but as we’ve seen, that doesn’t really do anything.
The Supreme Court will also try to adjudicate some of these disputes, and sometimes that settles a matter definitively, while other times it only introduces more complexity (like the TikTok situation, or how abortion became a state by state matter). Ultimately they are political appointees too (and you can see how the liberal and conservative justices vote differently… it’s pretty cut-and-dry partisanship on certain issues/cases).
In theory this is all a part of a complex system of checks and balances, but in reality, many of those checks and balances were devised in an era where the United States was much smaller, much less populated, and less subject to technological influences (everything from computer-assisted gerrymandering to precision polling to individually tracked social media and influencing), not to mention the gazillions of dollars that is disproportionately concentrated in the hands of a very few people. IMHO: the old checks and balances aren’t really able to keep up with modern shenanigans. Don’t think I can really get much more into that without straying into GD.
There are some reasonably good TV shows that depict the basic American political process, like Designated Survivor (US-based) and The Diplomat (US-UK relations, with politics of both countries). There are also older shows like House of Cards or West Wing, but I haven’t watched them.