It's been a common staple of philosophy that this holds. Thus, on determinism, is moral ought even possible? Assuming determinism is true, does saying "You should do X" make sense? For if things are determined, whether the person addressed will or not do X is out of their control.
The principle that "ought implies can" is called "Kant's law". It is used as a law within many systems of deontic logic. It can be formulated using a implication statement, and in the standard slogan, or it can be expressed by its contrapositive: "If something is impossible, then it cannot be obligatory".
This law is a sensible desiderata for deontic logic so long as the "ought" is a normative requirement that takes account of all surrounding circumstances. The law breaks down when we formulate an "ought" that makes prima facie prescriptions and does not take account of the surrounding context, so that it allows normative claims without consideration of the possible actions. For example, we might say, "You ought to return my property when you borrow it", and this is a decent prima facie normative claim. However, this normative prescription does not consider what you should do if you borrow my property and then it accidentally gets destroyed, or some other circumstance makes its return impossible.
In cases where we make "ought" statements that defy Kant's law, like the one above, the problem is not really with Kant's law, but with the fact that we are formulating "ought" statements that do not give a full prescription of the desired normative claim in all circumstances. Hence, it is reasonable to say that Kant's law is a desirable law of deontic logic, but we sometimes make ought statements more loosely than is strictly required, where we put forward a general normative claim that does not prescribe the desired behaviour in all possible circumstances.
Your thought that you 'ought' to do something is just one of the deterministic forces that cause it to happen. The question then becomes that of whether the thought that one 'ought' to do it is itself determined. A Buddhist would say it is the result of conditioning, therefore is determined. Here is a conversation with Gurdjieff...
“I asked G. what a man had to do to assimilate this teaching.
“What to do?” asked G. as though surprised. “It is impossible to do anything. A man must first of all understand certain things. He has thousands of false ideas and false conceptions, chiefly about himself, and he must get rid of some of them before beginning to acquire anything new. Otherwise the new will be built on a wrong foundation and the result will be worse than before.”
““How can one get rid of false ideas?” I asked. “We depend on the form of our perceptions. False ideas are produced by the forms of our perception.”
G shook his head.
“Again you speak of something different,” he said. “You speak of errors arising from perceptions but I am not speaking of these. Within the limits of given perceptions man can err more or err less. As I have said before, man’s chief delusion is his conviction that he can do. All people think that they can do, and the first question all people ask is what they are to do. But actually nobody does anything and nobody can do anything. This is the first thing that must be understood. Everything happens. All that befalls a man, all that is done by him, all that comes from him - all this happens. And it happens in exactly the same way as rain falls as a result of a change in the temperature in the higher regions of the atmosphere or the surrounding clouds, as snow melts under the rays of the sun, as dust rises with the wind. Everyone finds that nothing is being done in the way it ought to be done. Actually everything is being done in the only way that it can be done. If one thing could be different everything could be different. … Try to understand what I am saying. Everything is dependent on everything else, everything is connected, nothing is separate. Therefore everything is going in the only way it can go. If people were different everything would be different. They are what they are, so everything is as it is.”
This was very difficult to swallow.
“Is there nothing, absolutely nothing, that can be done?” I asked.
“And can nobody do anything?”
“That is another question. In order to do it is necessary to be. And it is necessary first to understand what to be means.”
P.D.Ouspensky Conversation with Gurdjieff In Search of the Miraculous - Fragments of an Unknown Teaching (1949)
This is not the case. Telling someone they aught to do something is just one more factor that will be taken into account when the choice is made by the person's mind. Whether or not you tell them they aught to do it is deterministic, and part of the chain reaction which results in their decision being made, but it plays a part in that decision making process.
The person may have no true choice over which outcome they pick, but they believe they do, and act like they do, so it is worth treating the situation as if they do. You're just introducing a new element into the calculation.
Simply telling them they aught to do something is unlikely to be enough, however, unless they hold you in high regard. You're best offering more variables for their calculation - explaining why you believe they aught to do it - that will increase the likelihood that their eventual conclusion will fall in line with yours. Unless they distrust everything you say, but again, that's another variable that needs to be taken into account.