Usecase : After creating vm with number of count ,when i reduce the count , it should remove specific VM

For example , I have created the 2 vms using count or for each loop (vm1 and vm2 )
In next deployment I am going to reduce the count to 1 , so that it will remove the one vm which should be specific one.

could some one help me , how to achieve this use case

With count you can’t choose which one will be removed - it will always be the second one. If you want to be able to choose you should look at using for_each instead